change to release mode #8
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: Quizz Backend | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup SSH | |
uses: webfactory/ssh-agent@v0.5.3 | |
with: | |
ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | |
- name: Deploy | |
run: | | |
ssh -o StrictHostKeyChecking=no ubuntu@${{ secrets.EC2_IP }} << 'EOF' | |
cd quizz | |
git stash | |
git pull origin main | |
git stash pop | |
go mod tidy | |
cd cmd/server | |
go build -o quizz-backend | |
screen -S quizz-backend -X quit || true | |
screen -dmS quizz-backend ./quizz-backend | |
screen -ls | |
EOF |