Skip to content

ci: restructure build pipeline for dual deployment#32

Merged
jamestelfer merged 4 commits intomainfrom
ci/restructure-build-pipeline
Mar 27, 2026
Merged

ci: restructure build pipeline for dual deployment#32
jamestelfer merged 4 commits intomainfrom
ci/restructure-build-pipeline

Conversation

@jamestelfer
Copy link
Copy Markdown
Contributor

@jamestelfer jamestelfer commented Mar 27, 2026

Purpose

Prepares the CI pipeline for dual deployment to both GitHub Pages and Cloudflare Pages by producing two distinct artifacts from a single build.

The existing withastro/action is an all-in-one action that bundles setup, install, build, and artifact upload into a black box. It only uploads a GitHub Pages artifact, which is insufficient for the upcoming Cloudflare Pages deployment that needs a generic dist/ artifact. Replacing it with explicit steps makes both artifacts available and gives the pipeline full control over the build process.

The workflow now also triggers on pull requests, enabling preview deployments in a future step. GitHub Pages deployment is guarded by an if condition so it only runs on push to main — PR builds run the full build and artifact upload without triggering a live deployment.

Context

  • Part of the Cloudflare Pages migration epic (chinmina-docs-7yn)
  • Prerequisite for adding the Cloudflare Pages deployment job (chinmina-docs-7yn.2)

Summary by CodeRabbit

  • Chores
    • Updated CI/CD workflow: added pull-request validation and retained manual triggers while keeping production pushes limited to main.
    • Switched to an explicit build pipeline with Node and package-manager setup and a pnpm-based build.
    • Improved artifact handling by uploading the built site for Pages and as a separate archive.
    • Upgraded workflow action versions and gated production deploy to pushes on main.

Replace withastro/action with explicit steps so the workflow produces
both a GitHub Pages artifact and a generic dist/ artifact. Adds
pull_request trigger for future preview support. GitHub Pages deploy
is conditioned on push to main so PRs don't trigger deployment.

Closes chinmina-docs-7yn.1
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Warning

Rate limit exceeded

@jamestelfer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 54 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 54 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c344ee7a-7615-4d94-8ff3-bca1d4299a1b

📥 Commits

Reviewing files that changed from the base of the PR and between 1f33420 and a1bbbc5.

📒 Files selected for processing (3)
  • .github/workflows/deploy.yaml
  • .mise.toml
  • .tool-versions

Walkthrough

The GitHub Actions workflow was reworked to replace the Astro action with explicit Node/pnpm build steps, add a pull_request trigger, upload dist/ as both a Pages artifact and a standard artifact, and conditionally run the deploy job only on pushes to refs/heads/main.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
​.github/workflows/deploy.yaml
Replaced withastro/action@v4 with an explicit build pipeline: actions/checkout@v6, actions/setup-node@v6 + corepack enable, pnpm install, pnpm run build. Added pull_request trigger, kept push (main) and workflow_dispatch. Uploads dist/ as a Pages artifact (actions/upload-pages-artifact@v4) and as a regular artifact (actions/upload-artifact@v7); upgraded actions/deploy-pages@v5. Added if condition so deploy runs only for push to refs/heads/main.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Trigger as Trigger (push / pull_request / workflow_dispatch)
participant Runner as Actions Runner
participant Repo as Repository (checkout)
participant Node as Node / pnpm
participant PagesArtifact as Pages Artifact Store
participant ArtifactStore as Artifact Store
participant Deploy as Deploy Pages

Trigger->>Runner: start workflow
Runner->>Repo: actions/checkout@v6
Runner->>Node: actions/setup-node@v6\ncorepack enable\npnpm install\npnpm run build
Node-->>Runner: build produces `dist/`
Runner->>PagesArtifact: actions/upload-pages-artifact@v4 (`dist/`)
Runner->>ArtifactStore: actions/upload-artifact@v7 (`dist/`)
alt event == push to refs/heads/main
    Runner->>Deploy: actions/deploy-pages@v5 (deploy `dist/`)
    Deploy-->>PagesArtifact: deploy artifact
end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A rabbit hops through CI/CD streams,
I swapped a step for clearer build routines,
PRs now wake the workflow's tune,
Main branch gates deploy by moon,
Dist artifacts bounce — hooray, more greens! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: restructuring the CI workflow's build pipeline to enable dual deployment to both GitHub Pages and Cloudflare Pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/restructure-build-pipeline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Replace non-existent enable-corepack input on setup-node with an
explicit corepack enable run step. Update actions to latest versions:
setup-node v6, upload-pages-artifact v4, upload-artifact v7,
deploy-pages v5.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy.yaml:
- Around line 24-29: The workflow step using actions/setup-node@v4 is
misconfigured: remove the unsupported enable-corepack input, add an explicit
node-version (e.g., 'lts/*' or specific semver) to the actions/setup-node@v4
step, then insert a new step that runs `corepack enable` before running `pnpm
install` so pnpm is guaranteed to be available; update the existing `Install
dependencies` step (which runs `pnpm install`) to remain after the `corepack
enable` step.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2055320a-be75-4947-8d38-3b70affd8af8

📥 Commits

Reviewing files that changed from the base of the PR and between 6a85cdd and 3a7ac2c.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yaml

Switch from mise.toml to the asdf-compatible .tool-versions file so
both mise and actions/setup-node (via node-version-file) read the
node version from a single authoritative source.
@jamestelfer jamestelfer merged commit 563e92b into main Mar 27, 2026
3 checks passed
@jamestelfer jamestelfer deleted the ci/restructure-build-pipeline branch March 27, 2026 11:37
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.

1 participant