aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml18
1 files changed, 11 insertions, 7 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 82188ba..565adde 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,7 +2,10 @@ name: Pantry build
on:
push:
- branches: [ "trunk" ]
+ branches:
+ - trunk
+ tags:
+ - v*
env:
IMAGE_NAME: ${{ github.repository }}
@@ -12,10 +15,6 @@ jobs:
runs-on: ubuntu-latest
- strategy:
- matrix:
- image-type: [ native, multistage ]
-
steps:
- uses: actions/checkout@v3
@@ -55,14 +54,19 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
+ tags: |
+ type=pep440,pattern={{version}}
+ type=pep440,pattern={{major}}.{{minor}}
+ type=pep440,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
+ type=ref,event=branch
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
push: true
- file: src/main/docker/Dockerfile.${{ matrix.image-type }}
- tags: ${{ env.IMAGE_NAME }}:${{ matrix.image-type }}
+ file: src/main/docker/Dockerfile.multistage
+ tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max