Update and restart STAFF server #1
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: Manual Deploy | |
| # Trigger via actions tab | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the repository | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| # Step 2: Connect to server via SSH and deploy | |
| - name: Deploy over SSH | |
| uses: appleboy/ssh-action@v1.2.0 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_KEY }} | |
| command_timeout: 10m | |
| script_stop: true | |
| script: | | |
| # Crash out on error | |
| set -e | |
| # CD to correct dir | |
| cd /root/staff-server | |
| # Ensure we are on the main branch | |
| git checkout main | |
| # Pull changes from main | |
| git pull origin main | |
| # Build and start container | |
| docker compose up --build --force-recreate --remove-orphans -d |