v2.08.13.2025-21.1-stable #41
Workflow file for this run
This file contains hidden or 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: Deploy Astroid API update via Github Actions | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published, edited] | |
| 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 | |
| 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 | |
| cp -r /root/guildcord/src/api.py /root/backup/guildcord/src/api.py | |
| update_api: | |
| runs-on: ubuntu-latest | |
| needs: [stop_api, backup_api] | |
| steps: | |
| - name: Pull 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 pull origin main | |
| cp -r /root/astroid/src/astroidapi /root/guildcord/src/astroidapi | |
| cp -r /root/astroid/src/api.py /root/guildcord/src/api.py | |
| cp -r /root/astroid/.git /root/guildcord/.git | |
| deploy_api: | |
| runs-on: ubuntu-latest | |
| needs: [stop_api, update_api, backup_api] | |
| steps: | |
| - 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 |