Merge pull request #628 from dzcode-io/project/hey-cli #22
Workflow file for this run
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: Deploy To Production Environment | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
uses: ./.github/workflows/ci.reusable.build.yml | |
with: | |
node-version: "20" | |
os: "ubuntu-latest" | |
bundle-deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
STAGE: production | |
SSH_ADDRESS_PRD: ${{ secrets.SSH_ADDRESS_PRD }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
DEPLOY_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('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: "Bundle info" | |
run: npm run generate:bundle-info $DEPLOY_VERSION production | |
- name: "Bundle ./web" | |
run: npx lerna run bundle:alone --scope @dzcode.io/web | |
- name: "Sentry Release" | |
run: npm run generate:sentry-release $DEPLOY_VERSION production ${{ secrets.SENTRY_AUTH_TOKEN }} | |
- name: "Pre-deploy" | |
run: npm run pre-deploy | |
- name: "Deploy" | |
run: npm run deploy | |
lighthouse: | |
needs: bundle-deploy | |
uses: ./.github/workflows/ci.reusable.lighthouse.yml | |
with: | |
serverBaseUrl: "https://lh.dzcode.io" | |
testBaseUrl: "https://www.dzcode.io" | |
stage: "production" | |
secrets: | |
LH_SERVER_TOKEN_STG: ${{ secrets.LH_SERVER_TOKEN_STG }} | |
LH_SERVER_TOKEN_PRD: ${{ secrets.LH_SERVER_TOKEN_PRD }} |