Skip to content

Commit 0f79f96

Browse files
Merge pull request #36 from score-spec/docker-github-builder
docker/github-builder
2 parents cf841aa + 3236aaa commit 0f79f96

File tree

2 files changed

+46
-33
lines changed

2 files changed

+46
-33
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ jobs:
2323
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
2424
with:
2525
version: latest
26+
test-multi-arch-build:
27+
uses: docker/github-builder/.github/workflows/build.yml@c767551a26459c30e1f683df73a12fdb918f7068 # v1.0.0
28+
if: ${{ !github.event.pull_request.head.repo.fork }}
29+
with:
30+
output: image
31+
push: false
32+
platforms: linux/amd64,linux/arm64
33+
sbom: true
34+
context: .
35+
set-meta-labels: true
36+
set-meta-annotations: true
37+
meta-images: |
38+
score-radius
39+
meta-tags: |
40+
type=ref,event=pr
41+
secrets:
42+
registry-auths: |
43+
- username: ${{ secrets.DOCKER_HUB_USERNAME }}
44+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
2645
test-container:
2746
runs-on: ubuntu-latest
2847
if: ${{ !github.event.pull_request.head.repo.fork }}

.github/workflows/release.yaml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
permissions:
77
contents: read
88
jobs:
9-
release:
9+
release-go-binary:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
id-token: write
@@ -42,37 +42,31 @@ jobs:
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
47-
- name: Login to Docker Hub (docker.io)
48-
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
49-
with:
50-
registry: docker.io
51-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
52-
password: ${{ secrets.DOCKER_HUB_RELEASE_TOKEN }}
53-
- name: Login to GitHub Container Registry
54-
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
55-
with:
56-
registry: ghcr.io
45+
release-container-image:
46+
uses: docker/github-builder/.github/workflows/build.yml@c767551a26459c30e1f683df73a12fdb918f7068 # v1.0.0
47+
permissions:
48+
id-token: write # to sign attestation(s) with GitHub OIDC Token
49+
packages: write # to push container image to ghcr
50+
with:
51+
output: image
52+
push: true
53+
platforms: linux/amd64,linux/arm64
54+
sbom: true
55+
context: .
56+
set-meta-labels: true
57+
set-meta-annotations: true
58+
build-args: |
59+
"VERSION=${{ github.ref_name }}"
60+
meta-images: |
61+
ghcr.io/score-spec/score-radius
62+
scorespec/score-radius
63+
meta-tags: |
64+
type=ref,event=tag
65+
latest
66+
secrets:
67+
registry-auths: |
68+
- registry: ghcr.io
5769
username: ${{ github.actor }}
5870
password: ${{ secrets.GITHUB_TOKEN }}
59-
- name: Build and push docker image
60-
id: build-push-container
61-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
62-
with:
63-
context: .
64-
platforms: linux/amd64,linux/arm64
65-
push: true
66-
provenance: mode=max
67-
sbom: true
68-
tags: |
69-
ghcr.io/score-spec/score-radius:${{ github.ref_name }}
70-
ghcr.io/score-spec/score-radius:latest
71-
docker.io/scorespec/score-radius:${{ github.ref_name }}
72-
docker.io/scorespec/score-radius:latest
73-
build-args: |
74-
"VERSION=${{ github.ref_name }}"
75-
- name: Sign container image
76-
run: |
77-
cosign sign --yes ghcr.io/score-spec/score-radius@${{ steps.build-push-container.outputs.digest }}
78-
cosign sign --yes scorespec/score-radius@${{ steps.build-push-container.outputs.digest }}
71+
- username: ${{ secrets.DOCKER_HUB_USERNAME }}
72+
password: ${{ secrets.DOCKER_HUB_RELEASE_TOKEN }}

0 commit comments

Comments
 (0)