Skip to content

Commit

Permalink
Build with labels and branches
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood authored May 15, 2024
1 parent d61a6b6 commit 9ee829d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- 'main'
- 'fix/**'
- 'dev'
- 'dev/**'
tags:
- 'v*.*.*'
env:
Expand Down Expand Up @@ -39,10 +42,10 @@ jobs:
id: metabackend
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_BACKEND }}
# Docker tags based on the following events/attributes
labels: |
org.opencontainers.image.title=ticketz-backend
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
Expand All @@ -54,10 +57,10 @@ jobs:
id: metafrontend
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_BACKEND }}
# Docker tags based on the following events/attributes
${{ env.REGISTRY }}/${{ env.IMAGE_FRONTEND }}
labels: |
org.opencontainers.image.title=ticketz-frontend
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
Expand All @@ -73,6 +76,7 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metabackend.outputs.tags }}
labels: ${{ steps.metabackend.outputs.labels }}

- name: Build and push frontend Docker image
id: frontend
Expand All @@ -82,3 +86,4 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metafrontend.outputs.tags }}
labels: ${{ steps.metafrontend.outputs.labels }}

0 comments on commit 9ee829d

Please sign in to comment.