Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/astroid-app/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Deutscher775 committed Aug 29, 2024
2 parents e759c96 + 54ac8d2 commit b07713b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/revoke_api_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Undo Astroid API update via Github Actions
on:
release:
types: [unpublished]

jobs:
stop_api:
runs-on: ubuntu-latest
steps:
- name: API Shutdown
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo systemctl stop astroidapi
revoke_changes:
runs-on: ubuntu-latest
needs: stop_api
- name: Revert changes
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /root/astroid
git reset --hard HEAD
git pull origin main
cp -r /root/astroid/src/astroidapi /root/guildcord/astroidapi
cp -r /root/astroid/src/api.py /root/guildcord/api.py
deploy_api:
runs-on: ubuntu-latest
needs: [stop_api, revoke_changes]
- name: Deploy API
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo systemctl start astroidapi

0 comments on commit b07713b

Please sign in to comment.