-
Notifications
You must be signed in to change notification settings - Fork 52
49 lines (40 loc) · 1.15 KB
/
migrate-v2.yaml
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
name: Migrate v2
on:
workflow_dispatch:
push:
branches:
- main
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Copy data over to backend
uses: burnett01/rsync-deployments@6.0.0
with:
switches: -avz
path: ./data/
remote_path: ${{ secrets.DEPLOY_PATH }}/data/
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Run migration on backend
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd ${{ secrets.DEPLOY_PATH }}
./seed_aredl
- name: Check exit code
if: ${{ failure() }}
run: exit 1
- name: Restart backend
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
script: sudo systemctl restart aredl-backend-v2