Add navigator SSR guards #112
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 to VM | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set release version | |
| id: release | |
| run: echo "release=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Set up SSH | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_KEY }} | |
| - name: Test SSH connection | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "echo ✅ SSH connection works!" | |
| - name: Check .env file presence | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "test -f /opt/simradar21/.env && echo '✅ .env file exists' || (echo '❌ .env file is missing' && exit 1)" | |
| - name: Copy files to VM | |
| run: | | |
| rsync -avz --delete \ | |
| --exclude=".env" \ | |
| --filter=":- .deployignore" \ | |
| -e "ssh -o StrictHostKeyChecking=no" \ | |
| ./ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/opt/simradar21 | |
| - name: Deploy on VM | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << EOF | |
| cd /opt/simradar21 | |
| export NEXT_PUBLIC_APP_RELEASE=${{ steps.release.outputs.release }} | |
| docker compose --env-file /opt/simradar21/.env -f docker/docker-compose.prod.yml down | |
| docker compose --env-file /opt/simradar21/.env -f docker/docker-compose.prod.yml build | |
| docker compose --env-file /opt/simradar21/.env -f docker/docker-compose.prod.yml up -d --remove-orphans | |
| EOF |