Skip to content

ci: deploy docs/ to Pages via a concurrency-guarded Actions workflow#28

Open
IvanBBaev wants to merge 1 commit into
mainfrom
ci/pages-actions-deploy
Open

ci: deploy docs/ to Pages via a concurrency-guarded Actions workflow#28
IvanBBaev wants to merge 1 commit into
mainfrom
ci/pages-actions-deploy

Conversation

@IvanBBaev

Copy link
Copy Markdown
Owner

Problem

GitHub Pages for this repo is served by the auto-generated legacy
pages-build-deployment pipeline (source: main/docs). That pipeline has
no concurrency guard. When several commits land on main in quick
succession (e.g. a run of dependabot / dependency-bump merges), each triggers
its own Pages deploy, and because GitHub Pages allows only one active
deployment
they race — the losers die with the generic
Deployment failed, try again later.

The site itself stays live (the last successful deploy wins), but the Actions
tab alternates green/red. Observed today: 13:26 ✅, 13:31 ❌, 13:38 ✅, 13:48 ❌.

Fix

A dedicated Pages workflow that:

  1. Only deploys when the published content changes (paths: docs/**), so
    dependency bumps no longer trigger a Pages deploy at all.
  2. Serializes the deploys that remain via
    concurrency: { group: pages, cancel-in-progress: false } — a constant group
    (no github.ref) queues every deploy behind the previous one instead of
    racing it; cancel-in-progress: false lets an in-flight deploy finish.

Content is served verbatim: docs/.nojekyll marks it as plain static HTML,
so upload-pages-artifact uploads the whole docs/ tree unchanged — identical
to what the legacy build served. Actions are SHA-pinned per repo convention.

Cutover (after merge)

The repo's Pages source must be switched from "Deploy from a branch" to
"GitHub Actions"
(build_type: workflow) for this workflow's deploy step to
take effect. The site keeps serving the last deployment during the switch — no
downtime, no content lost.

The auto-generated legacy pages-build-deployment (branch/`docs` source) has no
concurrency guard, so bursts of pushes to main raced on the single Pages
environment and the losers failed with "Deployment failed, try again later"
(the site stayed live via the last successful deploy, but the Actions tab went
red). Replace it with a dedicated workflow that (1) only deploys when docs/
actually changes and (2) serializes deploys via
`concurrency: { group: pages, cancel-in-progress: false }`. Content is served
verbatim (docs/.nojekyll marks it as plain static HTML).
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants