Skip to content

Update notification for newgame #92

Update notification for newgame

Update notification for newgame #92

Workflow file for this run

name: CI/CD
on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install requirements
run: pip install -r requirements.txt
- name: Lint Ruff
run: ruff check .
- name: Lint Flake8
run: flake8 .
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Copy repository contents via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSHKEY }}
source: "."
target: "/home/ubuntu/Hamster-code-generator"
- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSHKEY }}
script: |
cd /home/ubuntu/Hamster-code-generator
source .venv/bin/activate
pip install -r requirements.txt
ps aux | grep "python3 main.py" | grep -v grep | awk '{print $2}' | xargs -r kill -9
docker-compose stop
docker-compose up -d postgres backup redis
sleep 10
alembic upgrade head || { echo "Alembic migration failed"; exit 1; }
sudo systemctl restart telegram_bot.service
sudo systemctl restart keys_farm.service
create-release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: v1.7.0
name: "Release v1.7.0"
body: |
Added Redis, Ruff, new game 'Infected Frontier' | 🏖️
token: ${{ secrets.GITHUB_TOKEN }}