Skip to content

CNTRLPLANE-3997: add workflow to publish docs to Cloudflare Pages on merge - #9221

Merged
celebdor merged 2 commits into
openshift:mainfrom
celebdor:hs-docs-main
Aug 7, 2026
Merged

CNTRLPLANE-3997: add workflow to publish docs to Cloudflare Pages on merge#9221
celebdor merged 2 commits into
openshift:mainfrom
celebdor:hs-docs-main

Conversation

@celebdor

@celebdor celebdor commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a GitHub Actions workflow (docs-publish.yaml) that deploys HyperShift documentation to Cloudflare Pages production when docs changes are merged to main
  • Adds a reusable deploy workflow (docs-deploy-reusable.yaml) that supports both production (--production) and preview (--branch=<name>) deployment modes
  • Eliminates the current workaround of using the celebdor/hypershift fork to trigger production doc updates

Test plan

  • Verify workflow triggers on a docs/ change merged to main
  • Verify production deployment reaches hypershift.pages.dev
  • Verify existing PR preview flow (docs-build.yamldocs-deploy.yaml) is unaffected

Ref: CNTRLPLANE-3997

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added automated documentation deployment to Cloudflare Pages.
    • Supports both production releases and branch-specific preview deployments.
    • Documentation changes pushed to the main branch now trigger an automated build and production deployment.

Add a GitHub Actions workflow that deploys HyperShift documentation to
Cloudflare Pages production when docs changes are merged to main. This
eliminates the current workaround of using the celebdor/hypershift fork
to trigger production doc updates.

The implementation adds two files:
- docs-publish.yaml: triggers on push to main, orchestrates build and
  deploy using reusable workflows
- docs-deploy-reusable.yaml: parameterized deploy workflow supporting
  both production (--production) and preview (--branch=<name>) modes

Ref: CNTRLPLANE-3997

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@celebdor celebdor changed the title ci(docs): add workflow to publish docs to Cloudflare Pages on merge CNTRLPLANE-3997: add workflow to publish docs to Cloudflare Pages on merge Aug 4, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 4, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 4, 2026

Copy link
Copy Markdown

@celebdor: This pull request references CNTRLPLANE-3997 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds a GitHub Actions workflow (docs-publish.yaml) that deploys HyperShift documentation to Cloudflare Pages production when docs changes are merged to main
  • Adds a reusable deploy workflow (docs-deploy-reusable.yaml) that supports both production (--production) and preview (--branch=<name>) deployment modes
  • Eliminates the current workaround of using the celebdor/hypershift fork to trigger production doc updates

Test plan

  • Verify workflow triggers on a docs/ change merged to main
  • Verify production deployment reaches hypershift.pages.dev
  • Verify existing PR preview flow (docs-build.yamldocs-deploy.yaml) is unaffected

Ref: CNTRLPLANE-3997

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 8e44fd9a-855f-48a4-a2bc-b127c2bcfd9e

📥 Commits

Reviewing files that changed from the base of the PR and between 6317abc and cc11e0b.

📒 Files selected for processing (2)
  • .github/workflows/docs-deploy-reusable.yaml
  • .github/workflows/docs-publish.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/docs-deploy-reusable.yaml
  • .github/workflows/docs-publish.yaml

📝 Walkthrough

Walkthrough

Adds a reusable workflow for deploying the docs-site artifact to Cloudflare Pages. It supports production and branch-specific preview deployments. Adds a Docs Publish workflow that triggers on qualifying changes to main, controls concurrent runs, invokes the documentation build workflow, and starts production deployment with inherited secrets.

Sequence Diagram(s)

sequenceDiagram
  participant GitHub
  participant DocsBuild
  participant DocsDeploy
  participant CloudflarePages
  GitHub->>DocsBuild: build documentation on qualifying main push
  DocsBuild->>DocsDeploy: provide docs-site artifact
  DocsDeploy->>CloudflarePages: deploy production site with Wrangler
Loading

Suggested reviewers: cblecker, jparrill

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding workflows that publish documentation to Cloudflare Pages after merges.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR changes only two GitHub Actions YAML files; the commit diff contains no test paths or Ginkgo test-title declarations to flag.
Test Structure And Quality ✅ Passed The patch changes only two GitHub Actions workflow files and contains no Ginkgo test code or changed Go test files; the test-quality check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only two GitHub Actions workflows. They contain no Kubernetes manifests, controllers, replicas, affinity, topology spread, node selectors, tolerations, or PDBs.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The check is not applicable. The commit changes only two workflow YAML files and adds no Ginkgo, e2e, or network-dependent test code.
No-Weak-Crypto ✅ Passed The PR adds only GitHub Actions workflows; searches found no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The full PR adds only GitHub Actions workflows and declares no privileged:true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, or container settings.
No-Sensitive-Data-In-Logs ✅ Passed The added workflows contain no shell logging of sensitive values or literal credentials; Cloudflare secrets are passed by reference to the Wrangler action, and no PII indicators were found.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@celebdor celebdor added the area/ci-tooling Indicates the PR includes changes for CI or tooling label Aug 4, 2026
@openshift-ci
openshift-ci Bot requested review from cblecker and jparrill August 4, 2026 19:01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs-deploy-reusable.yaml:
- Around line 11-15: Update the workflow input definition for branch in
docs-deploy-reusable.yaml so preview deployments cannot proceed with an omitted
or empty branch when production is false or unset. Add validation or make branch
required for preview callers, while preserving production deployments that do
not need a branch.
- Around line 24-25: Update the job’s environment selection in the reusable
workflow so it uses docs-production when inputs.production is true and
docs-preview otherwise. Create and configure the docs-production environment
with the required protection rules, while preserving docs-preview for preview
deployments.

In @.github/workflows/docs-publish.yaml:
- Line 20: Pin the reusable workflow references in
.github/workflows/docs-publish.yaml at lines 20 and 27, and
.github/workflows/docs-build.yaml at line 14, to reviewed full commit SHAs
instead of `@main`. Preserve the existing workflow targets while ensuring all
referenced revisions are immutable.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: db99d299-9a02-45d4-a400-d5f15b9abd48

📥 Commits

Reviewing files that changed from the base of the PR and between 0cd0254 and 6317abc.

📒 Files selected for processing (2)
  • .github/workflows/docs-deploy-reusable.yaml
  • .github/workflows/docs-publish.yaml

Comment thread .github/workflows/docs-deploy-reusable.yaml
Comment thread .github/workflows/docs-deploy-reusable.yaml Outdated
Comment thread .github/workflows/docs-publish.yaml
- Use docs-production environment (restricted to main) for production
  deploys, docs-preview for previews
- Add concurrency group to docs-publish to prevent stale deploys from
  racing merges
- Guard preview deploy step against empty branch input

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@celebdor: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@csrwng

csrwng commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: celebdor, csrwng

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2026
@celebdor
celebdor merged commit bb403c3 into openshift:main Aug 7, 2026
19 of 20 checks passed
runs-on: arc-runner-set
timeout-minutes: 5
environment:
name: ${{ inputs.production && 'docs-production' || 'docs-preview' }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This references a docs-production GitHub Environment that doesn't exist yet (the existing preview workflow uses docs-preview). If the environment or its secrets (CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID) aren't created before this PR merges, the first push to main touching docs/ will fail silently (the deploy job will be blocked waiting for environment approval, or fail on missing secrets).

accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site --project-name=hypershift --production --commit-dirty=true
- name: Deploy to Cloudflare Pages (Preview)
if: ${{ !inputs.production && inputs.branch != '' }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow supports two modes — production (inputs.production) and preview (!inputs.production && inputs.branch). But the existing PR preview deployment in docs-deploy.yaml does not call this reusable workflow. That means:

  • The preview path in docs-deploy-reusable.yaml has no caller today
  • The existing docs-deploy.yaml has richer preview functionality (PR number extraction, GitHub deployment status creation with environment URL) that the reusable version lacks
  • There are now two deploy mechanisms: docs-deploy.yaml for previews and docs-deploy-reusable.yaml for production

Is the plan to migrate docs-deploy.yaml to use docs-deploy-reusable.yaml in a follow-up? If not, the preview path in the reusable workflow is dead code that could drift. If yes, the reusable version will need the deployment status logic from docs-deploy.yaml lines 45-77.

- main
paths:
- 'docs/**'
- '.github/workflows/docs-publish.yaml'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: paths doesn't include docs-build-reusable.yaml or docs-deploy-reusable.yaml. Probably fine since infrastructure changes alone don't warrant a content redeploy. But if a build fix needs to trigger redeployment, someone would need to make a no-op change to docs/. Worth noting in a comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ci-tooling Indicates the PR includes changes for CI or tooling jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants