ci: build-check on PRs + gate Pages deploy on release - #14
Merged
Conversation
- ci.yml (new): runs bun install --frozen-lockfile + bun run build on every PR and push to main. Verification only, no deploy. Catches build breakage (e.g. dependency bumps) before merge. Free/unlimited on this public repo. - deploy.yml: trigger changed from push:main -> release: published. Production deploys are now deliberate and versioned — publishing a GitHub release builds and deploys to Pages. workflow_dispatch retained for manual runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Improves GitHub Actions automation for this Astro/Bun-based GitHub Pages site by adding a non-deploying build verification workflow and gating production deployments behind published releases (plus a patch version bump).
Changes:
- Add
ci.ymlto runbun install --frozen-lockfileandbun run buildon PRs and pushes tomain(no deploy). - Update
deploy.ymlto deploy only onrelease: published(and keepworkflow_dispatch). - Bump
package.jsonversion from0.5.0to0.5.1.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Patch version bump to align with release-based deployment flow. |
| .github/workflows/deploy.yml | Switch production deploy trigger from push: main to release: published. |
| .github/workflows/ci.yml | New workflow to build-check PRs and main pushes without deploying. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+31
to
+35
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
|
|
Addresses Copilot review: 'bun-version: latest' makes CI non-deterministic. Pin to 1.3.14 (current latest stable) in a .bun-version file; both ci.yml and deploy.yml read it via setup-bun's bun-version-file input. Single source of truth, also picked up by local bun tooling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both workflows now write a markdown summary to $GITHUB_STEP_SUMMARY (shown on the run page): build job reports bun/node/astro versions + pages built; deploy job reports release tag + live site URL. Untrusted values (release tag, page url) passed via env vars, never interpolated into run commands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses Copilot review: deploy used plain 'bun install', so the production dependency graph could differ from what CI verified (and could silently mutate bun.lock). Use --frozen-lockfile to match ci.yml and keep release deploys reproducible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Supply-chain hardening: tags are mutable and can be repointed to malicious code, so pin every action to its latest-stable release commit SHA (tag kept as a comment for readability and Dependabot updates). - actions/checkout -> v7.0.0 9c091bb - actions/setup-node -> v6.4.0 48b55a0 - oven-sh/setup-bun -> v2.2.0 0c5077e - actions/upload-pages-artifact -> v5.0.0 fc324d3 - actions/deploy-pages -> v5.0.0 cd2ce8f Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| echo "| --- | --- |" | ||
| echo "| Bun | $(bun --version) |" | ||
| echo "| Node | $(node --version) |" | ||
| echo "| Astro | $(node -p "require('astro/package.json').version" 2>/dev/null || echo n/a) |" |
| echo "| --- | --- |" | ||
| echo "| Bun | $(bun --version) |" | ||
| echo "| Node | $(node --version) |" | ||
| echo "| Astro | $(node -p "require('astro/package.json').version" 2>/dev/null || echo n/a) |" |
Comment on lines
+52
to
+53
| echo "| Astro | $(node -p "require('astro/package.json').version" 2>/dev/null || echo n/a) |" | ||
| echo "| Pages built | $(find dist -name '*.html' 2>/dev/null | wc -l | tr -d ' ') |" |
Comment on lines
+52
to
+53
| echo "| Astro | $(node -p "require('astro/package.json').version" 2>/dev/null || echo n/a) |" | ||
| echo "| Pages built | $(find dist -name '*.html' 2>/dev/null | wc -l | tr -d ' ') |" |
Addresses Copilot review on the summary step. The nested-double-quote $(node -p "...") inside echo "..." actually works in bash (command substitution is its own quoting context — CI confirmed the step succeeded), but it is fragile to read. Precompute bun/node/astro/pages into variables with fallbacks so the heredoc only interpolates plain vars. Guard the page count behind [ -d dist ] so the step stays exit-0 under 'set -eo pipefail' even when if: always() runs it after a failed build (no dist dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two workflow improvements. Free/unlimited on this public repo (no Actions quota).
1.
ci.yml(new) — build verificationRuns
bun install --frozen-lockfile+bun run buildon every PR and push to main. Verification only, no deploy. Catches build breakage before merge (e.g. the Astro 7 bump in #13 had to be verified manually — this would have shown a ✓/✗ on the PR automatically).--frozen-lockfilealso catchesbun.lock/package.jsondrift.2.
deploy.yml— release-gated production deployTrigger changed
push: main→release: published. Merging to main no longer auto-deploys; instead production deploys are deliberate and versioned — publishing a GitHub release builds and deploys to Pages.workflow_dispatchretained for manual runs.Resulting flow
🤖 Generated with Claude Code