Skip to content

Deploy Web App: build and deploy in separate jobs - #731

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/deploy-web-split-jobs
Nov 22, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
fix/deploy-web-split-jobs

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

The v1.32.0 web deploy (Deploy Web App, run 45033007466) failed at "Deploy to GitHub Pages" with No artifacts named "github-pages" were found. A fresh workflow_dispatch run from main (45034693490) failed the same way. Its log shows the artifact finalized at 14:48:29.04 and deploy-pages listing the run's artifacts right after it: Found 0 artifact(s). That's actions/deploy-pages#451. When upload-pages-artifact and deploy-pages run in the same job, the lookup can come back empty for an artifact that was finalized a fraction of a second earlier.

Re-running the failed job can't recover. It uploads a second github-pages artifact to the same run, and deploy-pages then fails with Multiple artifacts named "github-pages" (run 45033007466, attempt 2).

Change

deploy-web.yml is split into two jobs, the layout GitHub's other Pages starter workflows use:

  • build: checkout, .NET, WASM publish, the .nojekyll/CNAME/404.html steps, and upload-pages-artifact. It has the workflow's top-level contents: read token, so the job that runs repository code no longer holds pages: write or id-token: write.
  • deploy (needs: build): deploy-pages only, with contents: read, pages: write and id-token: write (the same set the single job had), in the github-pages environment.

Triggers, concurrency, action pins and every build step are unchanged.

Reaching the live site

The github-pages environment deploys only from main, so this takes effect with the next release. Until then, a workflow_dispatch run from main can still hit the race. plans.erikdarling.com keeps serving the v1.31.0 build until a deploy succeeds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M98owbb9iKsAUWvSpjCFTz

deploy-pages listed the run's artifacts a fraction of a second after
upload-pages-artifact finalized in the same job and found none
(actions/deploy-pages#451). That failed the v1.32.0 web deploy twice, and a
re-run uploads a second github-pages artifact, which deploy-pages rejects. The
build job now runs the repository code with a contents: read token, and only
the deploy job holds pages: write and id-token: write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M98owbb9iKsAUWvSpjCFTz
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review November 22, 2026 14:50
@claude

claude Bot commented Nov 22, 2026

Copy link
Copy Markdown

Reviewed the workflow split in deploy-web.yml. It looks good, and I found nothing to flag.

  • Permissions are narrower: the build job keeps only contents: read, and pages: write and id-token: write are scoped to the deploy job.
  • The environment block moved to the deploy job along with steps.deployment.outputs.page_url, so the output reference still resolves.
  • upload-pages-artifact doesn't need the extra permissions.
  • The deploy job needs no checkout.
  • There are no version, Blazor-link or T-SQL implications.

I only read the diff and did not run the workflow. Confirm with a workflow_dispatch run after merge.

@erikdarlingdata
erikdarlingdata merged commit fe92edb into dev Nov 22, 2026
4 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/deploy-web-split-jobs branch November 22, 2026 14:51
@erikdarlingdata

Copy link
Copy Markdown
Owner Author

Probe results, from a throwaway branch with no deploy. Each job uploaded a Pages artifact with the same upload-pages-artifact pin and then looked it up by name through the artifact service, with download-artifact, the same service deploy-pages lists:

Artifact Lookup in the same job (~0.3 s after finalize) Lookup from a later job (~5-7 s after)
280 bytes (run 45035581866) 4 of 4 found 4 of 4 found
12.5 MB, the size of the web build (run 45035653119) 0 of 4 found ("Artifact not found") 4 of 4 found

So the service lists a large artifact a short time after it reports the upload finalized. A lookup inside that window misses, and the separate deploy job is well past it. The window varies. The 10-14 and 10-20 deploys found the artifact 0.42-0.48 s after finalize, while today's three failures looked 0.32-0.44 s after. A fourth dispatch from main (45035653157) looked 0.63 s after, found it, and deployed v1.32.0 to plans.erikdarling.com.

With the split, "Re-run failed jobs" re-runs only deploy, which uploads nothing. So a retry can recover now, where in the one-job layout it never could.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant