Post-Deploy Verify #890
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: Post-Deploy Verify | |
| on: | |
| deployment_status: | |
| workflow_dispatch: | |
| inputs: | |
| url: | |
| description: "URL to verify" | |
| required: false | |
| default: "https://www.nodebenchai.com" | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: post-deploy-verify-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| verify: | |
| # On deployment_status events, only run when state is success (skip pending, | |
| # failure, in_progress). The PRIOR if-clause also tried to skip Preview URLs | |
| # without a bypass secret using `vars.VERCEL_AUTOMATION_BYPASS_SECRET_PRESENT`, | |
| # but that var drifted out of sync with `secrets.VERCEL_AUTOMATION_BYPASS_SECRET` | |
| # and false-failed every dependabot PR's preview deploy with HTTP 401 SSO. | |
| # | |
| # The robust fix lives in scripts/post-deploy-verify.mjs: when running against | |
| # a Vercel preview URL (*.vercel.app) with no bypass secret in env, the script | |
| # now skips cleanly (exit 0 with skipped=true) instead of throwing 401. That | |
| # safety net works regardless of the var/secret sync state. | |
| if: | | |
| github.event_name != 'deployment_status' || | |
| github.event.deployment_status.state == 'success' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| package-manager-cache: false | |
| node-version-file: ".nvmrc" | |
| - name: Install dependencies | |
| run: npm install --no-audit --no-fund | |
| - name: Install Playwright browser | |
| run: npx playwright install chromium --with-deps | |
| - name: Resolve URL | |
| id: url | |
| run: | | |
| if [ "${{ github.event_name }}" = "deployment_status" ]; then | |
| URL="${{ github.event.deployment_status.environment_url }}" | |
| elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| URL="${{ github.event.inputs.url }}" | |
| else | |
| URL="https://www.nodebenchai.com" | |
| fi | |
| echo "url=$URL" >> "$GITHUB_OUTPUT" | |
| - name: Verify deployed app | |
| env: | |
| VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} | |
| run: node scripts/post-deploy-verify.mjs --url=${{ steps.url.outputs.url }} --json > post-deploy-result.json | |
| - name: Upload result | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: post-deploy-result-${{ github.run_id }} | |
| path: post-deploy-result.json | |
| retention-days: 30 |