Deploy To Stage Environment #261
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 Stage Environment | |
| on: | |
| push: | |
| tags: | |
| - "stg-v*" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| uses: ./.github/workflows/ci.reusable.build.yml | |
| with: | |
| node-version: "20" | |
| os: "ubuntu-latest" | |
| deploy-api: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: true | |
| STAGE: staging | |
| SSH_ADDRESS_STG: ${{ secrets.SSH_ADDRESS_STG }} | |
| DEPLOY_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('stg-0.0.0-{0}-{1}-{2}', github.ref_name, github.run_number, github.run_attempt) }} | |
| steps: | |
| - name: "Git" | |
| uses: actions/checkout@v4 | |
| - name: "Nodejs" | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - run: npm ci | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build output (ubuntu-latest, 20) | |
| - name: "SSH" | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_KEY }} | |
| known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
| - name: "Generate Bundle info" | |
| run: npm run generate:bundle-info $DEPLOY_VERSION stage | |
| - name: "Sentry Release" | |
| # todo-zm: remove sentry entirely | |
| run: cd ./api && npm run generate:sentry-release $DEPLOY_VERSION stage ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| - name: "Deploy" | |
| run: cd ./api && npm run deploy:stg |