Skip to content

ci: deploy Pages under a version of each run - #242

Merged
0kaba0hub merged 1 commit into
mainfrom
fix/deploy-own-pages-version
Oct 31, 2026
Merged

0kaba0hub merged 1 commit into
mainfrom
fix/deploy-own-pages-version

Conversation

@0kaba0hub

Copy link
Copy Markdown
Contributor

The v2.4.5 deploy runs succeeded, yet /2.4.5/ is still 404 and versions.json on the site is empty, while gh-pages already holds both.

Cause: actions/deploy-pages uses the commit SHA as the Pages build version. The release tag v2.4.5 sits on 2c59279, the commit the main deploy had already published, and Pages kept that first deployment. Every release lands the same way, because the release pipeline tags the head of main.

Change: the deploy job calls the Pages deployment API itself, with <sha>-<run id>-<attempt> as the build version, so each run is a deployment of its own.

  • The artifact id comes from upload-pages-artifact through a job output.
  • The OIDC token is masked. Both tokens go in headers read from a process substitution, never in a URL or an argument.
  • The job polls the deployment status and fails on a failed, cancelled or lost deployment, or after 10 minutes.

A branch cannot deploy to github-pages, so the merge is the first run. It also publishes 2.4.5, since the build packs the whole gh-pages branch.

actionlint is clean.

A release tag sits on the commit main already deployed, and Pages keeps the
first deployment of a build version, so the tag run reported success while
the site kept serving main's build. The deploy job now calls the Pages API
with <sha>-<run id>-<attempt> as the build version.
@0kaba0

0kaba0 commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

#242 (186582e): APPROVED. The merge is the first run of this step: after it I check versions.json and /2.4.5/ on the live site, not the job colour.

@0kaba0hub
0kaba0hub merged commit 6c51742 into main Oct 31, 2026
1 check passed
@0kaba0hub
0kaba0hub deleted the fix/deploy-own-pages-version branch October 31, 2026 16:24
0kaba0hub added a commit that referenced this pull request Oct 31, 2026
Pages answers 404 to a build version that is not a commit, so the
<sha>-<run>-<attempt> version failed the first deploy after #242. The
orphan commit each run pushes to gh-pages is new on every run, so it is
the version. A failed create now logs the API's answer.

Co-authored-by: Ihor Rusyn <0kaba0@gmail.com>
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