Skip to content

ci: build-check on PRs + gate Pages deploy on release - #14

Merged
cevheri merged 7 commits into
mainfrom
chore/ci-and-release-deploy
Jun 27, 2026
Merged

ci: build-check on PRs + gate Pages deploy on release#14
cevheri merged 7 commits into
mainfrom
chore/ci-and-release-deploy

Conversation

@cevheri

@cevheri cevheri commented Jun 27, 2026

Copy link
Copy Markdown
Member

Two workflow improvements. Free/unlimited on this public repo (no Actions quota).

1. ci.yml (new) — build verification

Runs bun install --frozen-lockfile + bun run build on 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-lockfile also catches bun.lock / package.json drift.

2. deploy.yml — release-gated production deploy

Trigger changed push: mainrelease: 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_dispatch retained for manual runs.

Resulting flow

PR / push main   → ci.yml: build check (no deploy)
publish release  → deploy.yml: build + deploy to Pages

🤖 Generated with Claude Code

cevheri and others added 2 commits June 27, 2026 20:59
- 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.yml to run bun install --frozen-lockfile and bun run build on PRs and pushes to main (no deploy).
  • Update deploy.yml to deploy only on release: published (and keep workflow_dispatch).
  • Bump package.json version from 0.5.0 to 0.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 thread .github/workflows/ci.yml
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/deploy.yml Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/ci.yml Outdated
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 thread .github/workflows/deploy.yml Outdated
echo "| --- | --- |"
echo "| Bun | $(bun --version) |"
echo "| Node | $(node --version) |"
echo "| Astro | $(node -p "require('astro/package.json').version" 2>/dev/null || echo n/a) |"

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/ci.yml Outdated
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 thread .github/workflows/deploy.yml Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@cevheri
cevheri merged commit 10510a5 into main Jun 27, 2026
5 checks passed
@cevheri
cevheri deleted the chore/ci-and-release-deploy branch June 27, 2026 18:19
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.

2 participants