Skip to content

Always run build job on all changes, deploy only on main branch#9

Merged
Rob Bos (rajbos) merged 2 commits into
mainfrom
copilot/fix-8
Jun 17, 2025
Merged

Always run build job on all changes, deploy only on main branch#9
Rob Bos (rajbos) merged 2 commits into
mainfrom
copilot/fix-8

Conversation

Copilot AI commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

Modified the GitHub Actions workflow to separate build validation from deployment:

Changes Made

Workflow Triggers:

  • Changed from push: branches: ["main"] to push: (all branches)
  • Added pull_request: trigger for PR validation

Deploy Job Condition:

  • Added if: github.ref == 'refs/heads/main' to the deploy job

Result

  • Build job now runs on ALL changes (any branch push, any PR) to validate that the code can still build
  • Deploy job only runs on main branch pushes to avoid unnecessary deployments
  • ✅ Manual workflow dispatch remains available
  • ✅ Minimal changes with proper conditional logic

This ensures continuous validation of buildability across all branches while maintaining controlled deployment only from the main branch.

Fixes #8.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Always run the build on changes Always run build job on all changes, deploy only on main branch Jun 17, 2025
Copilot AI requested a review from Rob Bos (rajbos) June 17, 2025 16:20
@rajbos Rob Bos (rajbos) marked this pull request as ready for review June 17, 2025 16:48
@rajbos Rob Bos (rajbos) merged commit 70fb6c6 into main Jun 17, 2025
1 check failed
@rajbos Rob Bos (rajbos) deleted the copilot/fix-8 branch June 17, 2025 16:48
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.

Always run the build on changes

2 participants