Deploy Frontend #15
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 Frontend | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| skip-cache: | |
| description: 'Skip deployment cache and force redeploy' | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| statuses: write | |
| id-token: write | |
| pull-requests: write | |
| concurrency: | |
| group: deploy-frontend-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # - name: Setup node | |
| # uses: ./.github/actions/setup-node | |
| # with: | |
| # NODEJS_VERSION: '22' | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| working-directory: frontend | |
| run: npm ci | |
| - name: Compute source hash | |
| id: source-hash | |
| run: echo "hash=$(find frontend/src frontend/public frontend/package.json frontend/next.config.js -type f 2>/dev/null | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| - name: Cache build | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| with: | |
| path: frontend/out | |
| key: build-${{ steps.source-hash.outputs.hash }} | |
| - name: Build app | |
| if: steps.cache-build.outputs.cache-hit != 'true' | |
| #run: yarn workspace @claude-certificate/frontend build | |
| working-directory: frontend | |
| run: npm run build | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-build | |
| path: frontend/out | |
| retention-days: 1 | |
| deploy: | |
| needs: build | |
| name: Deploy | |
| uses: ./.github/workflows/deploy-to-triangle.yml | |
| with: | |
| dotns-domain: ${{ github.event_name == 'push' && 'claude-certificate26.dot' || format('{0}-{1}00.dot', github.event.repository.name, github.event.pull_request.head.ref) }} | |
| artifact-name: frontend-build | |
| skip-cache: ${{ inputs.skip-cache || false }} | |
| secrets: | |
| mnemonic: ${{ secrets.MNEMONIC || 'bottom drive obey lake curtain smoke basket hold race lonely fit walk' }} |