Skip to content

Commit

Permalink
test on all branches, but only push image for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Oct 30, 2024
1 parent e5791cc commit 5b5993a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
paste_backlog_issue_link_here

---

### Added
-

Expand All @@ -18,7 +22,9 @@

---

### Feature PR Checklist
### PR Checklist

- [ ] Put version number in PR title (e.g. `Release x.y.z - Summary of changes`)
- [ ] Documentation (README, etc.)
- [ ] Unit tests created or updated
- [ ] Run `make composershow`
8 changes: 4 additions & 4 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Test and Publish

on:
push:
branches: [ 'main' ] #Trigger on Push event to 'main' branch
tags: [ '[0-9]+.[0-9]+.[0-9]+'] # Trigger for the version tags '1.0.1'

jobs:
tests:
Expand All @@ -24,6 +22,7 @@ jobs:
name: Build and Publish
needs: tests
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
timeout-minutes: ${{ fromJSON(vars.DEFAULT_JOB_TIMEOUT_MINUTES) }}
steps:
- name: Checkout code
Expand All @@ -47,12 +46,13 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository }}
${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand Down

0 comments on commit 5b5993a

Please sign in to comment.