Skip to content

Commit

Permalink
push image on feature branches
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Nov 21, 2024
1 parent 3b35947 commit d3bb054
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 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' ] #Triger on the main branch
tags: [ '[0-9]+.[0-9]+.[0-9]+' ] # Trigger on version tags like '0.1.0'

jobs:
tests:
Expand Down Expand Up @@ -39,10 +37,11 @@ jobs:

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
if: startsWith(github.ref, 'refs/tags')
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
Expand All @@ -55,7 +54,7 @@ jobs:
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit d3bb054

Please sign in to comment.