mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
fix: Only build and upload artifacts on main branch
Adds conditions to build and upload jobs to only run when triggered by pushes to the main branch, preventing unnecessary builds on pull requests. Changes: - Updated build-web job condition to include `github.ref == 'refs/heads/main'` - Updated build-release job condition to include `github.ref == 'refs/heads/main'` - Updated upload-to-release job condition to include `github.ref == 'refs/heads/main'` This ensures: - Pull requests only update the draft release notes (via release-drafter) - Actual builds and artifact uploads only happen on main branch pushes - More efficient CI/CD pipeline with reduced unnecessary builds 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2891eea03b
commit
f2c5716ad8
1 changed files with 3 additions and 3 deletions
6
.github/workflows/draft-release.yml
vendored
6
.github/workflows/draft-release.yml
vendored
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
build-web:
|
build-web:
|
||||||
name: Build Web App
|
name: Build Web App
|
||||||
needs: draft-release
|
needs: draft-release
|
||||||
if: needs.draft-release.outputs.tag-name != ''
|
if: needs.draft-release.outputs.tag-name != '' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -67,7 +67,7 @@ jobs:
|
||||||
build-release:
|
build-release:
|
||||||
name: Build Release - ${{ matrix.os }}
|
name: Build Release - ${{ matrix.os }}
|
||||||
needs: draft-release
|
needs: draft-release
|
||||||
if: needs.draft-release.outputs.tag-name != ''
|
if: needs.draft-release.outputs.tag-name != '' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -124,7 +124,7 @@ jobs:
|
||||||
upload-to-release:
|
upload-to-release:
|
||||||
name: Upload to GitHub Release
|
name: Upload to GitHub Release
|
||||||
needs: [draft-release, build-web, build-release]
|
needs: [draft-release, build-web, build-release]
|
||||||
if: needs.draft-release.outputs.tag-name != ''
|
if: needs.draft-release.outputs.tag-name != '' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue