Repository navigation
Conversation
validate-and-process.yml can now publish the built site to a branch (gh-pages by default) instead of committing build/ to the source branch and deploying a Pages artifact. It is selected from bblocks-config.yaml (bblocks-config-override.yml applies), with two new keys: - deploy.mode: "artifact" (default, current behavior) or "branch" - deploy.branch: branch to publish to in "branch" mode (default "gh-pages") In branch mode the workflow skips the build/ commit and the Pages artifact steps, mirrors the site into the target branch (created as an orphan branch if missing, with .nojekyll), and commits and pushes only when something changed. Hidden files, the cloned repositories and the scripts and URL mappings generated for them are left out. It fails early if GitHub Pages is not set to serve that branch, and waits for Pages to serve the new register.json before the triplestore upload job runs.
… yet In branch mode, the Pages source guard failed the run when Pages was still set to "GitHub Actions". But GitHub only lets you select an existing branch as the Pages source, and the first run is what creates it, so a first-time switch could never get past the guard. If the branch doesn't exist, warn (with what to set afterwards) instead of failing.
rob-metalinkage
left a comment
There was a problem hiding this comment.
Is this intended to be default? Or recommended?
|
The default is |
|
Let's see how it goes: fmigneault/bblocks-process-profiles-deploy-ghpages@693c45a |
|
It "works": https://github.com/fmigneault/bblocks-process-profiles-deploy-ghpages/deployments/github-pages A bit odd that it shows "Deploying to github-pages" during the build/validate phase, before the actual "upload" phase. https://github.com/fmigneault/bblocks-process-profiles-deploy-ghpages/actions/runs/40798904493 Build worked, but upload was skipped. Deploy reports it was done, but not the case. Does the
|
|
It seemed to have entered the usual "push commit |
|
my bad, forgot to refer at the relevant branch providing the CI feature 🤦 Now it worked as intended! However, the content is not where I would expect? |
|
Enabled GitHub Pages from config. Now it got picked up. |
…ranch mode The raw.githubusercontent.com fallback used context.ref_name, which does not exist in github-script's context, so the generated URL ended in /undefined. It now uses the ref being built. In deploy.mode: branch the site only exists on the deploy branch, so when the Pages API call fails (e.g. on the first run, before Pages is pointed at the branch) fall back to the default Pages URL instead.
|
@fmigneault thanks for testing! The Could you re-run the workflow on your register (it picks up the fix from this branch) and let me know how it goes? If you use a custom domain, set |
|
Rerunning it now creates this error: Not sure why yet because 88ed7ed doesn't look like it tweaks anything about permissions.
I had to manually apply
Retesting it now. |
|
Looks all good now: https://fmigneault.github.io/bblocks-process-profiles-deploy-ghpages/ |
…hub-pages environment The validate-and-process job declared the github-pages environment unconditionally. Once Pages is set to deploy from a branch, GitHub restricts that environment's deployment branches, so runs from the default branch were rejected before starting, even though branch mode never deploys through the Actions Pages API. actions/deploy-pages now runs in a separate deploy-pages job (artifact mode only) that holds the environment. upload-to-triplestore waits for it, using always() so that it still runs when deploy-pages is skipped in branch mode.
|
@fmigneault thanks, that error was a real bug on my side. The It's fixed in 51aed2f: the Actions-based deployment now lives in a separate I've tested it on a fresh repo created from bblocks-template, with Pages set to deploy from Could you re-run the workflow on your register (it picks up the fix from the |







Closes #46, closes #52. Relates to #102.
Adds an alternative to the current deployment: instead of committing
build/to the source branch and deploying a Pages artifact,validate-and-process.ymlcan publish the built site to a branch (gh-pagesby default). Source branches then stay free of build output, while the artifacts remain browsable and versioned in git.Configuration
In
bblocks-config.yaml(bblocks-config-override.ymlapplies as for other keys):Nothing changes for repos that don't set
deploy.What
mode: branchdoesbuild/commit to the source branch and the Pages artifact steps (configure-pages,upload-pages-artifact,deploy-pages).rsync --delete: created as an orphan branch if it doesn't exist,.nojekylladded (branch deployments would otherwise run Jekyll and drop underscore-prefixed paths), committed and pushed only if something changed. Each commit records the source commit in its message._repos_*clones and the scripts/URL mappings generated for them (abblocks-config-local.ymlshipped by the repo itself is kept)./ (root), instead of silently publishing to a branch nobody serves.register.json(checksum comparison) beforeupload-to-triplestoreruns, only when a SPARQL endpoint is configured, since a branch push deploys asynchronously.The
deploysection is also added tobblocks-config.schema.yaml(with tests); the postprocessor itself ignores it.Trying it on a register
process-bblocks.yml) at this branch:uses: opengeospatial/bblocks-postprocess/.github/workflows/validate-and-process.yml@deploy-mode-branch. Only the workflow file changes in this PR; the nestedfull@v1action and the Docker image are unchanged.deploy: {mode: branch}to itsbblocks-config.yaml.gh-pagesbranch (with a warning that Pages isn't serving it yet) and publishes the site to it.build/is not committed to the source branch.gh-pages,/ (root). The branch can't be selected before the first run has created it.To switch an existing register, also stop tracking
build/on the source branch (add it to.gitignoreandgit rm -r --cached build).Testing
bblocks-config-local.yml.Docs and template updates will follow once this is merged and released.