Skip to content

Commit 2df3581

Browse files
authored
Merge pull request #558 from crazy-max/github-builder
ci: use docker/github-builder to build, sign and push images
2 parents c68a6bf + 463f5e6 commit 2df3581

1 file changed

Lines changed: 26 additions & 52 deletions

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,58 +20,32 @@ on:
2020
paths-ignore:
2121
- '**.md'
2222

23-
env:
24-
DOCKERHUB_SLUG: librenms/librenms
25-
2623
jobs:
2724
build:
28-
runs-on: ubuntu-latest
29-
steps:
30-
-
31-
name: Login to DockerHub
32-
if: github.event_name != 'pull_request'
33-
uses: docker/login-action@v4
34-
with:
35-
username: ${{ secrets.DOCKER_USERNAME }}
25+
uses: docker/github-builder/.github/workflows/bake.yml@v1
26+
permissions:
27+
contents: read # same as global permissions
28+
id-token: write # for signing attestation(s) with GitHub OIDC Token
29+
with:
30+
setup-qemu: true
31+
target: image-all
32+
cache: true
33+
cache-scope: image
34+
output: image
35+
push: ${{ github.event_name != 'pull_request' }}
36+
set-meta-labels: true
37+
meta-images: |
38+
librenms/librenms
39+
meta-tags: |
40+
type=match,pattern=(.*)-r,group=1
41+
type=ref,event=pr
42+
type=edge
43+
meta-labels: |
44+
org.opencontainers.image.title=LibreNMS
45+
org.opencontainers.image.description=Fully featured network monitoring system
46+
org.opencontainers.image.vendor=LibreNMS
47+
secrets:
48+
registry-auths: |
49+
- registry: docker.io
50+
username: ${{ vars.DOCKER_USERNAME }}
3651
password: ${{ secrets.DOCKER_PASSWORD }}
37-
-
38-
name: Docker meta
39-
id: meta
40-
uses: docker/metadata-action@v6
41-
with:
42-
images: |
43-
${{ env.DOCKERHUB_SLUG }}
44-
tags: |
45-
type=match,pattern=(.*)-r,group=1
46-
type=ref,event=pr
47-
type=edge
48-
labels: |
49-
org.opencontainers.image.title=LibreNMS
50-
org.opencontainers.image.description=Fully featured network monitoring system
51-
org.opencontainers.image.vendor=LibreNMS
52-
-
53-
name: Set up QEMU
54-
uses: docker/setup-qemu-action@v4
55-
-
56-
name: Set up Docker Buildx
57-
uses: docker/setup-buildx-action@v4
58-
-
59-
name: Build
60-
uses: docker/bake-action@v7
61-
with:
62-
files: |
63-
./docker-bake.hcl
64-
cwd://${{ steps.meta.outputs.bake-file }}
65-
targets: image-all
66-
push: ${{ github.event_name != 'pull_request' }}
67-
-
68-
name: Check manifest
69-
if: github.event_name != 'pull_request'
70-
run: |
71-
docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
72-
-
73-
name: Inspect
74-
if: github.event_name != 'pull_request'
75-
run: |
76-
docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
77-
docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)