diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..9300d4c --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,34 @@ +# .gitea/workflows/deploy.yml + +name: Deploy ThorsHammerNew + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: linux + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + cd ${{ github.workspace }} + pip install -r requirements.txt + + - name: Copy files to app directory + run: | + rsync -av --delete \ + --exclude '.git' \ + --exclude '.gitea' \ + --exclude '*.db' \ + --exclude '.env' \ + --exclude 'ga_key.json' \ + ${{ github.workspace }}/ /var/www/thorshammernew/ + + - name: Restart app service + run: | + sudo systemctl restart thorshammernew \ No newline at end of file diff --git a/app.py b/app.py index ca1943a..2b739f5 100644 --- a/app.py +++ b/app.py @@ -315,6 +315,7 @@ def send_push_notification(name, job): print(f"Push notification failed: {response.status_code} - {response.text}") +init_db() + if __name__ == '__main__': - init_db() app.run(debug=True)