fixed the wrong folder.. sort of #9
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: 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 |