Skip to content

Commit 7f0371b

Browse files
Add attestations to images
1 parent 9ef748a commit 7f0371b

File tree

3 files changed

+54
-3
lines changed

3 files changed

+54
-3
lines changed

.github/workflows/docker-backup.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ on:
88
- backup/Dockerfile.*
99
- .github/workflows/docker-backup.yml
1010

11+
env:
12+
REGISTRY: index.docker.io
13+
IMAGE_NAME: binaryoverload/backup-client
14+
15+
permissions:
16+
id-token: write
17+
attestations: write
18+
1119
jobs:
1220
publish_backup:
1321
name: Publish Backup Images
@@ -30,7 +38,7 @@ jobs:
3038
id: meta
3139
uses: docker/metadata-action@v5
3240
with:
33-
images: binaryoverload/backup-client
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3442
tags: |
3543
type=raw,value=latest,enable=${{ matrix.os == 'ubuntu' }}
3644
type=raw,value=${{ matrix.os }}
@@ -40,6 +48,7 @@ jobs:
4048

4149
- name: Build and push Docker image
4250
uses: docker/build-push-action@v5
51+
id: push
4352
with:
4453
context: ./backup
4554
platforms: linux/amd64,linux/arm64
@@ -49,3 +58,11 @@ jobs:
4958
labels: ${{ steps.meta.outputs.labels }}
5059
cache-from: type=gha
5160
cache-to: type=gha,mode=max
61+
62+
- name: Attest
63+
uses: actions/attest-build-provenance@v2
64+
id: attest
65+
with:
66+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67+
subject-digest: ${{ steps.push.outputs.digest }}
68+
push-to-registry: true

.github/workflows/docker-mariadb.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ on:
88
- mariadb/Dockerfile.*
99
- .github/workflows/docker-mariadb.yml
1010

11+
env:
12+
REGISTRY: index.docker.io
13+
IMAGE_NAME: binaryoverload/mariadb-client
14+
15+
permissions:
16+
id-token: write
17+
attestations: write
18+
1119
jobs:
1220
publish_mariadb:
1321
name: Publish MariaDB Images
@@ -30,7 +38,7 @@ jobs:
3038
id: meta
3139
uses: docker/metadata-action@v5
3240
with:
33-
images: binaryoverload/mariadb-client
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3442
tags: |
3543
type=raw,value=latest,enable=${{ matrix.os == 'ubuntu' }}
3644
type=raw,value=${{ matrix.os }}
@@ -39,6 +47,7 @@ jobs:
3947
uses: docker/setup-buildx-action@v3
4048

4149
- name: Build and push Docker image
50+
id: push
4251
uses: docker/build-push-action@v5
4352
with:
4453
context: ./mariadb
@@ -49,3 +58,11 @@ jobs:
4958
labels: ${{ steps.meta.outputs.labels }}
5059
cache-from: type=gha
5160
cache-to: type=gha,mode=max
61+
62+
- name: Attest
63+
uses: actions/attest-build-provenance@v2
64+
id: attest
65+
with:
66+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67+
subject-digest: ${{ steps.push.outputs.digest }}
68+
push-to-registry: true

.github/workflows/docker-postgres.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ on:
88
- postgres/Dockerfile.*
99
- .github/workflows/docker-postgres.yml
1010

11+
env:
12+
REGISTRY: index.docker.io
13+
IMAGE_NAME: binaryoverload/postgres-client
14+
15+
permissions:
16+
id-token: write
17+
attestations: write
18+
1119
jobs:
1220
publish_postgres:
1321
name: Publish Postgres Images
@@ -38,7 +46,7 @@ jobs:
3846
id: meta
3947
uses: docker/metadata-action@v5
4048
with:
41-
images: binaryoverload/postgresql-client
49+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4250
tags: |
4351
type=raw,value=${{ matrix.postgres_version }},enable=${{ matrix.os == 'ubuntu' }}
4452
type=raw,value=${{ matrix.postgres_version }}-${{ matrix.os }}
@@ -48,6 +56,7 @@ jobs:
4856

4957
- name: Build and push Docker image
5058
uses: docker/build-push-action@v5
59+
id: push
5160
with:
5261
context: ./postgres
5362
platforms: linux/amd64,linux/arm64
@@ -59,3 +68,11 @@ jobs:
5968
POSTGRES_VERSION=${{ matrix.postgres_version }}
6069
cache-from: type=gha
6170
cache-to: type=gha,mode=max
71+
72+
- name: Attest
73+
uses: actions/attest-build-provenance@v2
74+
id: attest
75+
with:
76+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
77+
subject-digest: ${{ steps.push.outputs.digest }}
78+
push-to-registry: true

0 commit comments

Comments
 (0)