Zensical Publish Router
The zensical-publish-router workflow routes one Zensical publishing target to the matching destination-specific reusable workflow.
It receives exactly one target from zensical-publish-dispatch, then isolates provider-specific inputs and secrets from the dispatcher and from zensical-site-main.
Table of Contents
Responsibilities
- Receive exactly one publishing target from
zensical-publish-dispatch. - Select the matching destination-specific workflow.
- Pass the generated artifact name and source workflow run ID to the destination.
- Pass only provider-specific configuration and secrets to the provider that requires them.
Inputs
target: Required publishing target name.artifact-name: Name of the generated static-site artifact. Default:"zensical-site".run-id: Required workflow run ID containing the generated artifact.runner-image: GitHub-hosted runner image or self-hosted runner label.cloudflare-pages-project: Cloudflare Pages project name.cloudflare-pages-branch: Cloudflare Pages production or preview branch.cloudflare-wrangler-version: Wrangler version used for Cloudflare deployment.branch-name: Target branch forbranchdeployments.branch-commit-message: Commit message used for deployment-branch updates.
Secrets
release-bot-pat: Optional PAT or GitHub App token used bybranchpublishing.cloudflare-api-token: Required when routing tocloudflare-pages.cloudflare-account-id: Required when routing tocloudflare-pages.
Supported targets
github-pages: Routes tozensical-publish-gh-pages.cloudflare-pages: Routes tozensical-publish-cloudflare-pages.branch: Routes tozensical-publish-branch.
Example use
This workflow is normally called by the dispatcher matrix:
jobs:
publish:
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.validate.outputs.publish-targets) }}
uses: ./.github/workflows/zensical-publish-router.yml@main
with:
target: ${{ matrix.target }}
artifact-name: ${{ inputs.artifact-name }}
run-id: ${{ inputs.run-id }}
runner-image: ${{ inputs.runner-image }}
cloudflare-pages-project: ${{ inputs.cloudflare-pages-project }}
cloudflare-pages-branch: ${{ inputs.cloudflare-pages-branch }}
cloudflare-wrangler-version: ${{ inputs.cloudflare-wrangler-version }}
branch-name: ${{ inputs.branch-name }}
branch-commit-message: ${{ inputs.branch-commit-message }}
secrets:
release-bot-pat: ${{ secrets.release-bot-pat }}
cloudflare-api-token: ${{ secrets.cloudflare-api-token }}
cloudflare-account-id: ${{ secrets.cloudflare-account-id }}