Skip to content

Commit 3f8b12a

Browse files
committed
Use experimental Docker builder for proper versioning
1 parent 1ca3176 commit 3f8b12a

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

.github/workflows/docker.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
name: Docker
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
5-
branches: [ main ]
6-
7-
jobs:
8-
build-and-push:
9-
runs-on: ubuntu-latest
8+
branches:
9+
- 'main'
10+
tags:
11+
- '4.*'
12+
pull_request:
1013

11-
name: Container Image
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: mback2k/action-docker-package@master
15-
with:
16-
registry_username: ${{ github.repository_owner }}
17-
registry_password: ${{ secrets.GITHUB_TOKEN }}
14+
build:
15+
uses: docker/github-builder-experimental/.github/workflows/build.yml@main
16+
permissions:
17+
contents: read # to fetch the repository content
18+
id-token: write # for signing attestation(s) with GitHub OIDC Token
19+
with:
20+
output: image
21+
push: ${{ github.event_name != 'pull_request' }}
22+
platforms: linux/amd64,linux/arm64
23+
build-args: |
24+
version=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
25+
meta-images: |
26+
ghcr.io/${{ github.repository }}
27+
meta-tags: |
28+
type=pep440,pattern={{version}}
29+
type=ref,event=branch
30+
type=ref,event=pr

0 commit comments

Comments
 (0)