fix(agent-runtime): align npm bootstrap and release documentation #333
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: CI / Deploy | |
| on: | |
| push: | |
| paths: | |
| - "app/**" | |
| - ".github/workflows/deploy-web.yml" | |
| pull_request: | |
| paths: | |
| - "app/**" | |
| - ".github/workflows/deploy-web.yml" | |
| jobs: | |
| lint: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: app/.nvmrc | |
| cache: yarn | |
| cache-dependency-path: app/yarn.lock | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| working-directory: app | |
| - name: Prettier | |
| run: npx prettier --check . | |
| working-directory: app | |
| - name: ESLint | |
| run: yarn lint --max-warnings 0 | |
| working-directory: app | |
| - name: Type check | |
| run: yarn type-check | |
| working-directory: app | |
| deploy: | |
| name: Build & Deploy | |
| needs: lint | |
| if: github.ref == 'refs/heads/cf-sfu' && github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: cf-sfu-deploy | |
| cancel-in-progress: true | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: app/.nvmrc | |
| cache: yarn | |
| cache-dependency-path: app/yarn.lock | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| working-directory: app | |
| - name: Build | |
| run: yarn cf-build | |
| working-directory: app | |
| env: | |
| NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${{ secrets.NEXT_PUBLIC_TURNSTILE_SITE_KEY }} | |
| - name: Validate deployment variables | |
| run: test -n "$SFU_APP_ID" | |
| env: | |
| SFU_APP_ID: ${{ secrets.SFU_APP_ID }} | |
| # Second, independent guard against a stale deploy (the concurrency | |
| # group above should normally prevent this by cancelling an | |
| # in-progress older run, but this check covers any window where an | |
| # older run's Deploy step is reached anyway). "Stale" means cf-sfu | |
| # now has a commit that itself touches app/ or this workflow file — | |
| # see check-deploy-freshness.sh for why raw SHA equality against | |
| # cf-sfu's tip is wrong under this workflow's path-filtered push | |
| # trigger (a docs-only commit landing afterward must NOT mark an | |
| # in-flight app deploy stale). `set -euo pipefail` here means a | |
| # fetch/resolution failure fails this step (and the job) visibly — | |
| # it must never be silently treated as "stale, skip deploy, job | |
| # green". No extra token needed: actions/checkout persists | |
| # credentials for the job by default, so `git fetch origin` works. | |
| - name: Verify this commit is still the latest deploy-relevant cf-sfu push | |
| id: freshness | |
| run: | | |
| set -euo pipefail | |
| git fetch --depth=1 origin cf-sfu | |
| latest_sha="$(git rev-parse --verify FETCH_HEAD)" | |
| echo "Building commit: $GITHUB_SHA" | |
| echo "Latest cf-sfu: $latest_sha" | |
| result="$(.github/scripts/check-deploy-freshness.sh "$GITHUB_SHA" "$latest_sha")" | |
| echo "$result" >> "$GITHUB_OUTPUT" | |
| if [ "$result" = "stale=true" ]; then | |
| echo "::notice::Skipping deploy — cf-sfu has a newer commit ($latest_sha) that touches app/ or this workflow file. That commit's own run will (or already did) cover this push." | |
| fi | |
| - name: Deploy | |
| if: steps.freshness.outputs.stale != 'true' | |
| run: | | |
| npx wrangler deploy \ | |
| --var "SFU_APP_ID:${SFU_APP_ID}" \ | |
| --var "AGENT_MEDIA_ENABLED:true" | |
| working-directory: app | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| SFU_APP_ID: ${{ secrets.SFU_APP_ID }} |