Host a staging instance of Surge #38
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: Host a staging instance of Surge | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| staging: | |
| name: Build and deploy to staging | |
| runs-on: self-hosted | |
| steps: | |
| - name: Pull latest code and deploy with Docker | |
| run: | | |
| cd /home/ubuntu/clones/surge-staging | |
| export GIT_SSH_COMMAND="ssh -i /home/ubuntu/.ssh/gh-actions -o IdentitiesOnly=yes" | |
| git fetch origin | |
| git checkout ${{ github.ref_name }} | |
| git reset --hard origin/${{ github.ref_name }} | |
| docker compose --profile prod down | |
| docker compose --profile prod up --build -d |