This commit is contained in:
34
.gitea/workflows/deploy.yml
Normal file
34
.gitea/workflows/deploy.yml
Normal file
@@ -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
|
||||||
3
app.py
3
app.py
@@ -315,6 +315,7 @@ def send_push_notification(name, job):
|
|||||||
print(f"Push notification failed: {response.status_code} - {response.text}")
|
print(f"Push notification failed: {response.status_code} - {response.text}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
init_db()
|
init_db()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user