Skip to content

Track deployments via GitHub Deployments API#431

Merged
tiffehr merged 5 commits intomainfrom
copilot/rework-main-deployment-increment
Mar 9, 2026
Merged

Track deployments via GitHub Deployments API#431
tiffehr merged 5 commits intomainfrom
copilot/rework-main-deployment-increment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

Implementation Complete: GitHub Deployments for SRCCON ✅

Objective Achieved

Deployments are now tracked in GitHub's Deployments section with auto-increment behavior on each merge to main or staging branches, making them easily visible instead of only in the Actions tab.

Decision: GitHub Deployments (not Releases)

GitHub Deployments chosen because:

  • Purpose-built for deployment tracking
  • Support multiple environments (staging, production)
  • Show deployment history and status in GitHub UI
  • Auto-increment with each deployment
  • Better fit than Releases (which are for versioned software artifacts)

Implementation Complete

  • Update .github/workflows/deploy.yml to create GitHub Deployment events
    • Add deployment creation step before S3 sync
    • Add deployment status update (success/failure) after deployment
    • Configure environment names (staging, production)
    • Add deployments: write permission
    • Fix environment URLs to use proper S3 website endpoint and production domain
    • Add deployment ID existence checks in failure status updates
    • Fix step IDs to use underscores instead of hyphens for proper referencing
  • Update documentation (README.md) to mention Deployments
    • Added deployment tracking info to Branch Strategy section
    • Added links to Deployments tab in staging/production sections
    • Updated workflow description to mention deployment tracking
    • Fixed deployment links to use absolute URLs
  • Validate YAML and run tests ✅
  • Address all code review feedback ✅
  • Security scan (CodeQL) passed ✅
  • Test staging deployment workflow (requires merge to staging branch)
  • Test production deployment workflow (requires merge to main branch)
  • Verify deployments appear in GitHub UI under Deployments tab

Changes Made

  1. .github/workflows/deploy.yml (~95 lines modified):

    • Added deployments: write permission
    • Create deployment before S3 sync (staging/production)
    • Update deployment status after deployment completes
    • Proper error handling for failure scenarios
    • Fixed step IDs: deployment_staging and deployment_production (using underscores)
  2. README.md (+6 lines):

    • Document GitHub Deployments integration
    • Add absolute links to Deployments tab
    • Update workflow descriptions

Benefits

  • Better Visibility: Deployments in dedicated GitHub section
  • 📊 Environment Tracking: Staging vs Production separation
  • 📜 Deployment History: Timeline and status at a glance
  • 🔗 Direct Links: URL to deployed site in each deployment
  • Status Tracking: Success/failure for each deployment
  • 🔄 Auto-increment: Each merge creates new deployment entry

Testing Results

  • ✅ YAML validation passed
  • ✅ Jekyll build successful
  • ✅ All lint checks passed
  • ✅ All tests passed
  • ✅ Code review feedback addressed (step IDs and README links fixed)
  • ✅ Security scan (CodeQL) passed

Next Steps

  1. Merge this PR to the branch
  2. Test by merging to staging branch - check Deployments tab
  3. Test by merging to main branch - check Deployments tab
  4. Verify deployment URLs work correctly
Original prompt

This section details on the original issue you should resolve

<issue_title>Rework main deployment to increment a release</issue_title>
<issue_description>Auto-increment based on merges to main.</issue_description>

<agent_instructions>Valid merges to staging and main branches are published to a a static site hosted on S3. These can be seen in the Actions tab, but I'd like to see them under either Deployments or Releases as a datestamped "latest" publishing event. Decide which is the better association within GitHub's features and draft the work.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits March 8, 2026 20:40
Co-authored-by: tiffehr <60173+tiffehr@users.noreply.github.com>
Co-authored-by: tiffehr <60173+tiffehr@users.noreply.github.com>
Co-authored-by: tiffehr <60173+tiffehr@users.noreply.github.com>
Copilot AI changed the title [WIP] Rework main deployment to increment a release Track deployments via GitHub Deployments API Mar 8, 2026
Copy link
Copy Markdown
Member

@tiffehr tiffehr left a comment

Choose a reason for hiding this comment

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

👍 let's give it a try on staging.

@tiffehr tiffehr marked this pull request as ready for review March 8, 2026 20:54
Copilot AI review requested due to automatic review settings March 8, 2026 20:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub Deployments API tracking to the existing Jekyll-to-S3/CloudFront deployment workflow so staging/production publishes show up in the repo’s Deployments UI (with environment URLs), and documents how to view that status from the README.

Changes:

  • Add GitHub Deployments creation + success/failure status updates to .github/workflows/deploy.yml.
  • Grant deployments: write permission to the deploy workflow.
  • Update README.md to reference the Deployments tab and describe the new tracking behavior.

Reviewed changes

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

File Description
.github/workflows/deploy.yml Creates deployment records and posts deployment statuses (success/failure) with environment URLs.
README.md Documents deployment tracking and adds links intended to point to the Deployments tab.

Comment on lines +121 to +124
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: ${{ steps.deployment-staging.outputs.result }},
state: 'success',
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The step IDs deployment-staging / deployment-production contain hyphens, but later they’re referenced with dot-notation (steps.deployment-staging...). In GitHub Actions expressions, IDs with - must be accessed with bracket syntax (e.g. steps['deployment-staging'].outputs.result) or renamed to use _. As written, deployment_id will not resolve correctly and the status update will fail.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback, this feedback, this feedback, which are all pretty much the same issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8e0f17b:

Step IDs: Changed from deployment-staging/deployment-production to deployment_staging/deployment_production (using underscores instead of hyphens). This allows proper dot-notation access in GitHub Actions expressions.

README links: Changed from relative ../../deployments to absolute https://github.com/OpenNews/srccon/deployments to ensure the links work correctly from any viewing context.

All references throughout the workflow have been updated to use the new step IDs.

- Change step IDs from deployment-staging/deployment-production to deployment_staging/deployment_production (underscores instead of hyphens)
- Update all references to use the new step IDs with dot notation
- Fix README deployment links from relative (../../deployments) to absolute (https://github.com/OpenNews/srccon/deployments)

Co-authored-by: tiffehr <60173+tiffehr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 9, 2026

👍 let's give it a try on staging.

Ready for testing! The workflow will create GitHub Deployment records when merged to staging. You'll be able to see them at https://github.com/OpenNews/srccon/deployments with the staging environment URL and deployment status.

@tiffehr tiffehr merged commit a993b30 into main Mar 9, 2026
6 checks passed
@tiffehr tiffehr deleted the copilot/rework-main-deployment-increment branch March 9, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework main deployment to increment a release

3 participants