-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 2.01 KB
/
prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: gpxvis.com
on:
push:
branches: ['main']
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Stop GPX Vis and force-remove previous artifact
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
sudo systemctl stop ${{ secrets.DAEMON_NAME }}
sudo rm -rf ${{ secrets.DEPLOY_PATH }}
- name: Upload updated flask code
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
port: ${{ secrets.DEPLOY_PORT }}
source: "src"
target: ${{ secrets.DEPLOY_PATH }}
tar_tmp_path: ${{ secrets.TEMP_PATH }}
rm: false
timeout: 60s
- name: Install Flask dependencies and restart Flask
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
pip3 install -r ${{ secrets.DEPLOY_PATH }}/src/requirements.txt
touch ${{ secrets.DEPLOY_PATH }}/src/.env
echo APP_ADDRESS="${{ secrets.APP_ADDRESS }}" >> ${{ secrets.DEPLOY_PATH}}/src/.env
echo STRAVA_CLIENT_ID="${{ secrets.STRAVA_CLIENT_ID }}" >> ${{ secrets.DEPLOY_PATH}}/src/.env
echo STRAVA_CLIENT_SECRET="${{ secrets.STRAVA_CLIENT_SECRET }}" >> ${{ secrets.DEPLOY_PATH}}/src/.env
sudo systemctl restart ${{ secrets.DAEMON_NAME }}