Skip to content

Commit 6217dc9

Browse files
committed
Docker: Adjust image builder configuration
- Use semver tagging for releases. - Build and publish images on pull requests.
1 parent fcbd32b commit 6217dc9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/release-docker-full.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ jobs:
4444
# Generate Docker tags based on the following events/attributes
4545
tags: |
4646
type=schedule,pattern=nightly
47-
type=ref,event=tag
47+
type=ref,event=pr
48+
type=semver,pattern={{version}}
49+
type=semver,pattern={{major}}.{{minor}}
4850
-
4951
name: Inspect meta
5052
run: |
@@ -75,7 +77,6 @@ jobs:
7577
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
7678
-
7779
name: Login to GHCR
78-
if: github.event_name != 'pull_request'
7980
uses: docker/login-action@v2
8081
with:
8182
registry: ghcr.io
@@ -90,7 +91,7 @@ jobs:
9091
platforms: linux/amd64,linux/arm64,linux/arm/v7
9192
tags: ${{ steps.meta.outputs.tags }}
9293
labels: ${{ steps.meta.outputs.labels }}
93-
push: ${{ github.event_name != 'pull_request' }}
94+
push: true
9495
cache-from: type=local,src=/tmp/.buildx-cache
9596
cache-to: type=local,dest=/tmp/.buildx-cache-new
9697

.github/workflows/release-docker-standard.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ jobs:
4444
# Generate Docker tags based on the following events/attributes
4545
tags: |
4646
type=schedule,pattern=nightly
47-
type=ref,event=tag
47+
type=ref,event=pr
48+
type=semver,pattern={{version}}
49+
type=semver,pattern={{major}}.{{minor}}
4850
-
4951
name: Inspect meta
5052
run: |
@@ -75,7 +77,6 @@ jobs:
7577
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
7678
-
7779
name: Login to GHCR
78-
if: github.event_name != 'pull_request'
7980
uses: docker/login-action@v2
8081
with:
8182
registry: ghcr.io
@@ -90,7 +91,7 @@ jobs:
9091
platforms: linux/amd64,linux/arm64,linux/arm/v7
9192
tags: ${{ steps.meta.outputs.tags }}
9293
labels: ${{ steps.meta.outputs.labels }}
93-
push: ${{ github.event_name != 'pull_request' }}
94+
push: true
9495
cache-from: type=local,src=/tmp/.buildx-cache
9596
cache-to: type=local,dest=/tmp/.buildx-cache-new
9697

0 commit comments

Comments
 (0)