Skip to content

Tag and release the site when a deploy publishes a new version - #172

Merged
sdh100shaun merged 4 commits into
mainfrom
feature/release-on-deploy
Sep 3, 2026
Merged

Tag and release the site when a deploy publishes a new version#172
sdh100shaun merged 4 commits into
mainfrom
feature/release-on-deploy

Conversation

@sdh100shaun

Copy link
Copy Markdown
Collaborator

Why

The site has published to Pages on every push to main and daily since the Astro rebuild, but nothing recorded what went out when — gh release list is empty, the only tag is backup/pre-split-chore-dependabot-batch, and package.json has sat at 2.0.0. There's no version to point at, no changelog, and nothing to roll back to by name.

What this does

deploy.yml gains a third job, release, that runs once the Pages deploy succeeds:

  • package.json is the source of truth. It creates tag v<version> and a Release with generated notes, but only when that version has no release yet — so a release happens exactly when someone bumps the version in a PR, and every other push is a no-op.
  • Pushes to main only. The daily 06:00 cron rebuild and workflow_dispatch deploy exactly as before but skip the job, since they republish identical content. Releasing on the cron would mean ~365 releases a year for no change.

It checks for the release rather than the tag, which keeps re-runs idempotent and self-heals a tag left behind without one. gh release create creates the tag at --target itself, so there's no separate git tag && git push to keep in sync.

Supporting changes

File Change
.github/release.yml New. Groups generated notes: Listings (event-suggestion) → Dependencies (dependencies) → Changes (*, catch-all last), so meetup listings don't read the same as a feature change.
process-suggestion.yml Adds labels: event-suggestion to the create-pull-request step. The label was only ever applied to the issue, so the Listings category would have matched nothing.
ci.yml fetch-depth: 0 on the build checkout, plus a non-blocking ::notice:: when a PR touches files outside src/content/meetups/** without a version bump.
package.json 2.0.02.1.0.
CLAUDE.md Documents the flow in Deployment and CI.

Verified locally

  • All four YAML files parse; deploy.yml exposes build, deploy, release with the expected needs / if / permissions, and the suggestion step's labels reads back as event-suggestion.
  • The reminder script run against real repo state: quiet with the bump present, and fires ::notice:: when the version is simulated as unchanged. A touched meetup file is correctly filtered out of the "code changes" list.
  • gh release view v2.1.0 exits 1, so the first deploy after merge will create the release rather than skip.
  • npm run build passes.

Two things to know before merging

The first release will have long notes. There's no prior release for --generate-notes to bound against, so v2.1.0 picks up the whole history. One-off; later releases are scoped to the previous tag.

The version bump is manual, and the CI notice is the only nudge. That's deliberate — content PRs are the common case, shouldn't bump anything, and shouldn't show a contributor a red check. If it proves too easy to ignore, the follow-up is making it a required check, not auto-bumping.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D46yvMekBML3gD9k4xSeZ3

The site has published to Pages on every push to main and daily since the
Astro rebuild, but nothing recorded what went out when: no releases, no
version tags, and package.json stuck at 2.0.0.

deploy.yml gains a `release` job that runs once the Pages deploy succeeds
and creates tag v<package.json version> plus a GitHub Release with
generated notes — but only when that version has no release yet, so
package.json is the trigger and every other push is a no-op. It is gated
to pushes: the daily cron rebuild republishes identical content, so
releasing on it would add a release a day for no change.

Supporting changes:

  - .github/release.yml groups the generated notes by label, so meetup
    listings don't read the same as a feature change.
  - process-suggestion.yml now labels the PR it opens, not just the
    issue — the Listings category would otherwise match nothing.
  - ci.yml prints a non-blocking notice when a PR changes files outside
    src/content/meetups/** without bumping the version. Advisory by
    design: content PRs are the common case and shouldn't show a
    contributor a red check.

Bumped to 2.1.0 so the first automated release has a version of its own.
Its notes will span the whole history, there being no earlier tag to
bound them; later releases are scoped to the previous one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D46yvMekBML3gD9k4xSeZ3
@sdh100shaun
sdh100shaun requested review from a team and a lite review from Copilot August 30, 2026 10:32

Copilot AI 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.

Pull request overview

This PR adds an automated release/tagging step to the GitHub Pages deploy workflow so that production deployments can be referenced by version (v<package.json version>) and get generated release notes.

Changes:

  • Add a release job to .github/workflows/deploy.yml that creates a GitHub Release (and tag) on pushes to main, but skips scheduled/dispatch deploys.
  • Add .github/release.yml to group generated release notes by PR labels (Listings/Dependencies/Changes), and ensure suggestion PRs get the event-suggestion label.
  • Add a CI ::notice:: reminder when a PR changes non-listing files without bumping package.json version; bump version to 2.1.0 and document the flow in CLAUDE.md.

Reviewed changes

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

Show a summary per file
File Description
package.json Bumps site version to 2.1.0 as the release trigger.
CLAUDE.md Documents the new deploy/release workflow and version-bump contract.
.github/workflows/process-suggestion.yml Labels auto-opened suggestion PRs as event-suggestion to support release note grouping.
.github/workflows/deploy.yml Adds a post-deploy release job to create a release/tag based on package.json version (push-only).
.github/workflows/ci.yml Fetches full git history and adds a non-blocking version-bump reminder notice for code-changing PRs.
.github/release.yml Configures release note categories for --generate-notes based on labels.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CLAUDE.md Outdated
Co-authored-by: sdh100shaun <79883+sdh100shaun@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 30, 2026 10:36

Copilot AI 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.

Pull request overview

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

Suppressed comments (1)

CLAUDE.md:141

  • In this new deployment/release documentation, process-suggestion.yml and ci.yml are referenced without their .github/workflows/ path, while surrounding bullets use full workflow paths. Using the full paths here too avoids ambiguity and keeps the section consistent.
  `process-suggestion.yml` labels the PR it opens and not just the issue.
  `ci.yml`'s `build` job prints a non-blocking `::notice::` when a PR changes

Comment thread .github/workflows/deploy.yml
Comment thread .github/workflows/ci.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 31, 2026 17:14

Copilot AI 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.

Pull request overview

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

Copilot AI review requested due to automatic review settings August 31, 2026 17:17

Copilot AI 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.

Pull request overview

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

@sdh100shaun
sdh100shaun merged commit 7336d01 into main Sep 3, 2026
11 of 14 checks passed
@sdh100shaun
sdh100shaun deleted the feature/release-on-deploy branch September 3, 2026 06:56
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.

5 participants