Skip to content

ci: deploy the site with actions/deploy-pages - #501

Merged
mnencia merged 1 commit into
mainfrom
dev/pages-from-actions
Oct 21, 2026
Merged

mnencia merged 1 commit into
mainfrom
dev/pages-from-actions

Conversation

@mnencia

@mnencia mnencia commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

The site was published by pushing the built files to the gh-pages branch, so anyone with write access could push a commit there and change the live site without a build or review. Upload the built site as a Pages artifact and deploy it with actions/deploy-pages instead. Only a run on the production branch deploys, and the build job is read-only. This needs the Pages source set to GitHub Actions. The README publishing section is updated to match.


Do not fast-forward production after merging this until the Pages source is switched, or the deploy job fails and the site stays on its last version.

Switching the source is a repository setting, not part of this PR. Order that keeps the downtime short:

  1. Merge this PR into main. Nothing changes on the site.
  2. Fast-forward production. The build runs, and the deploy job fails while Pages is still in branch mode, so the old site keeps serving.
  3. Switch the source and keep the domain: gh api -X PUT repos/cloudnative-pg/cloudnative-pg.github.io/pages -f build_type=workflow -f cname=cloudnative-pg.io -F https_enforced=true, then immediately re-run the failed deploy job, which reuses the build artifact.
  4. Restrict the github-pages environment to the production branch, check the site, and update the Pages entry of this repo in cnpg-infra (workflow, main).
  5. Keep gh-pages and its ruleset for a while. Rollback is build_type=legacy.

Checked so far: actionlint passes, and a manual run from this branch only builds. The built public/ has the same 4,203 files as the gh-pages branch except CNAME and .nojekyll, which only matter for branch-based Pages. The docs site at /docs/ is a separate project site and takes its domain from this repository's Pages settings, which stay. The action versions are the same pinned v5 releases that cloudnative-pg/docs uses.

@mnencia
mnencia requested a review from a team as a code owner October 21, 2026 10:06
@mnencia
mnencia force-pushed the dev/pages-from-actions branch from 1b6a85d to 2641b16 Compare October 21, 2026 10:09
The site was published by pushing the built files to the gh-pages
branch, so anyone with write access could push a commit there and change
the live site without a build or review. Upload the built site as a
Pages artifact and deploy it with actions/deploy-pages instead. Only a
run on the production branch deploys, and the build job is read-only.
This needs the Pages source set to GitHub Actions. The README publishing
section is updated to match.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
@mnencia
mnencia force-pushed the dev/pages-from-actions branch from 2641b16 to 0fc64f5 Compare October 21, 2026 10:24
@mnencia mnencia changed the title ci: publish the site with the GitHub Pages Actions deployment ci: deploy the site with actions/deploy-pages Oct 21, 2026
@mnencia
mnencia merged commit 1ea068b into main Oct 21, 2026
5 checks passed
@mnencia
mnencia deleted the dev/pages-from-actions branch October 21, 2026 10:26
gbartolini pushed a commit to cloudnative-pg/cnpg-infra that referenced this pull request Oct 21, 2026
)

Before this change, `scripts/check-repo-settings.sh
cloudnative-pg.github.io` reported `Build type: workflow (expected:
legacy)`. With it, build type, source (`production/`) and custom domain
all match, with no drift.

The site change is cloudnative-pg/cloudnative-pg.github.io#501.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.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