jiri0462 created a new user: jiri113 #2188
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |