Release Manual #1
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: Release Manual | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| deploy_production: | |
| description: Deploy production on Vercel | |
| required: true | |
| default: true | |
| type: boolean | |
| permissions: | |
| contents: read | |
| jobs: | |
| preflight: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| run: pnpm typecheck | |
| release: | |
| if: ${{ inputs.deploy_production }} | |
| needs: preflight | |
| runs-on: ubuntu-latest | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| PRODUCTION_HEALTHCHECK_URL: ${{ secrets.PRODUCTION_HEALTHCHECK_URL }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Validate deploy secrets | |
| run: | | |
| missing=0 | |
| for key in VERCEL_TOKEN VERCEL_ORG_ID VERCEL_PROJECT_ID; do | |
| if [ -z "${!key}" ]; then | |
| echo "::error::Missing ${key} secret" | |
| missing=1 | |
| fi | |
| done | |
| if [ "${missing}" -ne 0 ]; then | |
| exit 1 | |
| fi | |
| - name: Install Vercel CLI | |
| run: npm install -g vercel@latest | |
| - name: Pull project settings | |
| run: vercel pull --yes --environment=production --token="${VERCEL_TOKEN}" | |
| - name: Build deployment artifact | |
| run: vercel build --prod --token="${VERCEL_TOKEN}" | |
| - name: Deploy production artifact | |
| run: vercel deploy --prebuilt --prod --yes --token="${VERCEL_TOKEN}" | |
| - name: Smoke check | |
| if: ${{ env.PRODUCTION_HEALTHCHECK_URL != '' }} | |
| run: | | |
| curl --fail --silent --show-error "${PRODUCTION_HEALTHCHECK_URL}" |