Skip to content

Commit

Permalink
backuing up api before replacing images
Browse files Browse the repository at this point in the history
  • Loading branch information
Deutscher775 authored Aug 30, 2024
1 parent b07713b commit 789f468
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/automated_api_stable_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@ jobs:
port: ${{ secrets.SSH_PORT }}
script: |
sudo systemctl stop astroidapi
backup_api:
runs-on: ubuntu-latest
needs: stop_api
steps:
- name: Backup API image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cp -r /root/guildcord/src/astroidapi /root/backup/guildcord/src/astroidapi
cp -r /root/guildcord/src/api.py /root/backup/guildcord/src/api.py
update_api:
runs-on: ubuntu-latest
needs: stop_api
needs: [stop_api, backup_api]
steps:
- name: Pull changes
uses: appleboy/ssh-action@master
Expand All @@ -31,12 +45,12 @@ jobs:
script: |
cd /root/astroid
git pull origin main
cp -r /root/astroid/src/astroidapi /root/guildcord/astroidapi
cp -r /root/astroid/src/api.py /root/guildcord/api.py
cp -r /root/astroid/src/astroidapi /root/guildcord/src/astroidapi
cp -r /root/astroid/src/api.py /root/guildcord/src/api.py
deploy_api:
runs-on: ubuntu-latest
needs: [stop_api, update_api]
needs: [stop_api, backup_api, update_api]
steps:
- name: Deploy API
uses: appleboy/ssh-action@master
Expand Down

0 comments on commit 789f468

Please sign in to comment.