Track deployments via GitHub Deployments API#431
Conversation
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>
tiffehr
left a comment
There was a problem hiding this comment.
👍 let's give it a try on staging.
There was a problem hiding this comment.
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: writepermission to the deploy workflow. - Update
README.mdto 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. |
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| deployment_id: ${{ steps.deployment-staging.outputs.result }}, | ||
| state: 'success', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@copilot apply changes based on this feedback, this feedback, this feedback, which are all pretty much the same issue.
There was a problem hiding this comment.
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>
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. |
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
mainorstagingbranches, making them easily visible instead of only in the Actions tab.Decision: GitHub Deployments (not Releases)
✅ GitHub Deployments chosen because:
Implementation Complete
.github/workflows/deploy.ymlto create GitHub Deployment eventsdeployments: writepermissionChanges Made
.github/workflows/deploy.yml(~95 lines modified):deployments: writepermissiondeployment_staginganddeployment_production(using underscores)README.md(+6 lines):Benefits
Testing Results
Next Steps
stagingbranch - check Deployments tabmainbranch - check Deployments tabOriginal prompt
maindeployment to increment a release #430✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.