GitHub Actions Docs Release Environment Setup
GitHub Actions Docs Release Environment Setup
1. Purpose
Define the exact GitHub Environments, secrets, and variables required by the docs release workflow for Core and ERO Starlight deployments to Cloudflare Pages.
This guide tells you what to copy from settings/.env* after environments are created.
2. Required GitHub Environments
Create these GitHub Environments in repository settings:
docs-01-developmentdocs-02-testdocs-03-production
Recommended protection:
docs-03-production: live environment, require reviewers and wait timer if needed.docs-02-test: next release environment, use reviewers when release validation needs approval.docs-01-development: development environment, typically no required reviewers.
3. Required Environment Secrets
Set these secrets in docs-01-development, docs-02-test, and docs-03-production.
| GitHub secret name | Source in settings files | Notes |
|---|---|---|
CLOUDFLARE_API_TOKEN | CLOUDFLARE_API_TOKEN from settings/.env.local | Cloudflare API token used by Wrangler deploy action. |
CLOUDFLARE_ACCOUNT_ID | mirrored from SKNX_CLOUDFLARE_ACCOUNT_ID by sync script, fallback CLOUDFLARE_ACCOUNT_ID/TF_VAR_CLOUDFLARE_ACCOUNT_ID from env files | Use the Cloudflare account id for the target account. |
4. Optional Environment Variables
Set these as GitHub Environment variables when you want release branding and project names to match your local settings.
| GitHub variable name | Source in settings files | Default if omitted |
|---|---|---|
SKNX_ERO_AZURE_COMPANY_NAME | SKNX_ERO_AZURE_COMPANY_NAME from settings/.env.local | Synkronyx |
SKNX_DOCS_PLATFORM_BRAND | SKNX_DOCS_PLATFORM_BRAND from settings/.env.example or local env | SynkronyXr |
SKNX_DOCS_GITHUB_REPO_URL | SKNX_DOCS_GITHUB_REPO_URL from settings/.env.example or local env | https://github.com/synkronyx/event-route-optimiser |
SKNX_DOCS_CORE_SITE_URL | SKNX_DOCS_CORE_SITE_URL from settings/.env.example or local env | https://docs.synkronyx.com in production, https://test-docs.synkronyx.com in test, and https://dev-docs.synkronyx.com in development |
SKNX_DOCS_ERO_SITE_URL | SKNX_DOCS_ERO_SITE_URL from settings/.env.example or local env | https://ero-docs.synkronyx.com in production, https://test-ero-docs.synkronyx.com in test, and https://dev-ero-docs.synkronyx.com in development |
SKNX_DOCS_CORE_TITLE | SKNX_DOCS_CORE_TITLE from settings/.env.example or local env | SynkronyXr Core Docs |
SKNX_DOCS_ERO_TITLE | SKNX_DOCS_ERO_TITLE from settings/.env.example or local env | Event Route Optimiser Docs |
SKNX_DOCS_CORE_DESCRIPTION | SKNX_DOCS_CORE_DESCRIPTION from settings/.env.example or local env | Synkronyx shared platform standards and governance |
SKNX_DOCS_ERO_DESCRIPTION | SKNX_DOCS_ERO_DESCRIPTION from settings/.env.example or local env | Event Route Optimiser product documentation |
CLOUDFLARE_CORE_PAGES_PROJECT | if managed in settings, use your chosen canonical value | sknx-docs in production, sknx-test-docs in test, and sknx-dev-docs in development |
CLOUDFLARE_ERO_PAGES_PROJECT | if managed in settings, use your chosen canonical value | sknx-ero-docs in production, sknx-test-ero-docs in test, and sknx-dev-ero-docs in development |
SKNX_CLOUDFLARE_ACCOUNT_ID | canonical source key in settings/.env* files | Preferred source key for Cloudflare account id in this repository. |
TF_VAR_CLOUDFLARE_ACCOUNT_ID | derived from SKNX_CLOUDFLARE_ACCOUNT_ID by sync script | Mirrored automatically for Terraform-style consumers that expect TF_VAR_* keys. |
5. Release Routing Behavior
The workflow routes deployment environment automatically:
release_environment=productionusesdocs-03-production(live).release_environment=testusesdocs-02-test(next release).release_environment=developmentusesdocs-01-development(development).
Tag rules:
docs-release-v*deploys both Core and ERO.docs-core-v*deploys Core only.docs-ero-v*deploys ERO only.docs-test-release-v*deploys both Core and ERO to test.docs-test-core-v*deploys Core only to test.docs-test-ero-v*deploys ERO only to test.docs-dev-release-v*deploys both Core and ERO to development.docs-dev-core-v*deploys Core only to development.docs-dev-ero-v*deploys ERO only to development.
6. Verified Cloudflare Pages project to URL mapping
Recorded 2026-08-02 after DNS and Pages domain reconciliation.
| Cloudflare Pages project | URL | Expected HTTP status |
|---|---|---|
sknx-docs | https://docs.synkronyx.com | 200 |
sknx-ero-docs | https://ero-docs.synkronyx.com | 200 |
sknx-dev-docs | https://dev-docs.synkronyx.com | 200 |
sknx-dev-ero-docs | https://dev-ero-docs.synkronyx.com | 200 |
sknx-test-docs | https://test-docs.synkronyx.com | 200 |
sknx-test-ero-docs | https://test-ero-docs.synkronyx.com | 200 |
7. Verification checklist
After secrets and variables are configured:
- Run workflow
Docs Release to Cloudflare Pagesmanually forcoreandrelease_environment=development. - Confirm deploy runs against
docs-01-development. - Run workflow manually for
coreandrelease_environment=test. - Confirm deploy runs against
docs-02-test. - Run workflow manually for
bothandrelease_environment=production. - Confirm production approval gate is enforced.
- Confirm Core and ERO Pages projects receive updated artifacts.
8. One-command synchronization from settings files
Use script scripts/sync-github-docs-environments.ps1 to create and update GitHub Environments, secrets, and variables from your settings/.env* files.
Examples:
# Dry run preview for all environments./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target all -WhatIf
# Apply updates for all environments./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target all
# Apply only production./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target production
# Apply only test./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target test
# Apply only development./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target development
# Apply only development using alias target./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target dev
# Legacy alias: both maps to all (production, test, development)./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target both
# Apply environment updates and repository-level variables./scripts/sync-github-docs-environments.ps1 -Repository synkronyx/event-route-optimiser -Target all -SetRepositoryVariablesRequired local prerequisites:
- GitHub CLI installed (
gh). - Valid
ghauthentication againstgithub.com. - Local
settings/.env.localwithCLOUDFLARE_API_TOKEN. - Local environment files with Cloudflare account id where applicable:
settings/.env.dev.localsettings/.env.test.localsettings/.env.prod.local
- Optional defaults in
settings/.env.examplefor docs branding values.
9. Security notes
- Never commit raw token values into any file under source control.
- Rotate
CLOUDFLARE_API_TOKENafter initial setup if token was ever exposed outside secret storage. - Keep production, test, and development secret values separate if different Cloudflare accounts are used.
10. GitVersion semantic versioning
Docs release versioning is GitVersion-driven and semantic:
- Workflow
Docs Release to Cloudflare Pagesruns GitVersion on every release build. - GitVersion derives
semVerfrom Git history and docs release tags. - Build step exports
SKNX_DOCS_RELEASE_VERSIONto docs generation. - Published Core and ERO sites display the release version in:
- sidebar label
- generated docs home page release callout
Commit message bump directives:
+semver: major+semver: minor+semver: patch+semver: none
11. Pull request docs preview
Use workflow Docs PR Preview (.github/workflows/docs-pr-preview.yml) to deploy docs for PR review before merge.
Behavior:
- Triggered by pull request changes affecting docs content or docs build scripts.
- Builds Core and ERO docs with a PR semantic preview version (
<semVer>-pr.<number>). - Deploys both sites to Cloudflare Pages preview branch
pr-<pull_request_number>. - Posts preview URLs back to the PR as a bot comment.
Default preview projects:
- Core previews use
sknx-dev-docs. - ERO previews use
sknx-dev-ero-docs.
Optional generic preview projects:
- Set repository variable
CLOUDFLARE_PR_CORE_PAGES_PROJECT(example:pr-docs). - Set repository variable
CLOUDFLARE_PR_ERO_PAGES_PROJECT(example:pr-ero-docs).
When these are set, PR previews deploy to those project names instead of development project names.
Forked PR note:
- Preview deploy is skipped for forked PRs because repository secrets are not exposed to forks.