Skip to content

Commit 484a3ae

Browse files
committed
Fix glob for digest files
1 parent d897327 commit 484a3ae

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

.github/workflows/docker-build-simple.libsonnet

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ local runnersMap = {
99
};
1010

1111
local setupSteps = function(region) [
12-
{ uses: 'docker/setup-buildx-action@v2' },
12+
{ uses: 'docker/setup-buildx-action@v3' },
1313
{
14-
uses: 'aws-actions/configure-aws-credentials@v1',
14+
uses: 'aws-actions/configure-aws-credentials@v4',
1515
with: {
1616
'aws-region': region,
1717
'role-to-assume': 'arn:aws:iam::005216166247:role/GhaDockerPush',
1818
'role-skip-session-tagging': true,
1919
},
2020
},
2121
{
22-
uses: 'aws-actions/amazon-ecr-login@v1',
22+
uses: 'aws-actions/amazon-ecr-login@v2',
2323
id: 'login-ecr',
2424
},
2525
];
@@ -37,7 +37,6 @@ function(name, region='ap-northeast-1', platforms=['linux/arm64']) {
3737
},
3838
jobs: {
3939
build: {
40-
name: 'build',
4140
strategy: {
4241
matrix: {
4342
include: std.map(function(platform) {
@@ -47,11 +46,12 @@ function(name, region='ap-northeast-1', platforms=['linux/arm64']) {
4746
}, platforms),
4847
},
4948
},
49+
name: 'build (${{ matrix.platform }})',
5050
'runs-on': '${{ matrix.runner }}',
5151
permissions: { 'id-token': 'write', contents: 'read' },
5252
steps: setupSteps(region) + [
5353
{
54-
uses: 'docker/build-push-action@v3',
54+
uses: 'docker/build-push-action@v6',
5555
id: 'build-push',
5656
with: {
5757
context: std.format('{{defaultContext}}:%s', name),
@@ -60,7 +60,7 @@ function(name, region='ap-northeast-1', platforms=['linux/arm64']) {
6060
},
6161
},
6262
{
63-
name: 'Export digest',
63+
name: 'Export digests',
6464
run: |||
6565
mkdir -p "${RUNNER_TEMP}/digests"
6666
printenv DIGEST > "${RUNNER_TEMP}/digests/${PLATFORM}"
@@ -72,6 +72,7 @@ function(name, region='ap-northeast-1', platforms=['linux/arm64']) {
7272
},
7373
},
7474
{
75+
name: 'Upload digests',
7576
uses: 'actions/upload-artifact@v4',
7677
with: {
7778
name: 'digests-${{ matrix.key }}',
@@ -88,6 +89,7 @@ function(name, region='ap-northeast-1', platforms=['linux/arm64']) {
8889
permissions: { 'id-token': 'write' },
8990
steps: setupSteps(region) + [
9091
{
92+
name: 'Download digests',
9193
uses: 'actions/download-artifact@v4',
9294
with: {
9395
path: '${{ runner.temp }}/digests',
@@ -98,10 +100,11 @@ function(name, region='ap-northeast-1', platforms=['linux/arm64']) {
98100
{
99101
name: 'Push manifest',
100102
run: |||
101-
cat * | xargs -I{} printf "%s@%s" "${REPO}" {} | docker buildx imagetools create -f /dev/stdin -t "${REPO}:latest" -t "${REPO}:${SHA}"
103+
cat "${RUNNER_TEMP}"/digests/* | xargs -I{} printf "%s@%s" "${REPO}" {} | docker buildx imagetools create -f /dev/stdin -t "${REPO}:latest" -t "${REPO}:${SHA}"
102104
docker buildx imagetools inspect "${REPO}:${SHA}"
103105
|||,
104106
env: {
107+
RUNNER_TEMP: '${{ runner.temp }}',
105108
REPO: std.format('${{ steps.login-ecr.outputs.registry }}/%s', name),
106109
SHA: '${{ github.sha }}',
107110
},

.github/workflows/docker-unbound.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"jobs": {
33
"build": {
4-
"name": "build",
4+
"name": "build (${{ matrix.platform }})",
55
"permissions": {
66
"contents": "read",
77
"id-token": "write"
88
},
99
"runs-on": "${{ matrix.runner }}",
1010
"steps": [
1111
{
12-
"uses": "docker/setup-buildx-action@v2"
12+
"uses": "docker/setup-buildx-action@v3"
1313
},
1414
{
15-
"uses": "aws-actions/configure-aws-credentials@v1",
15+
"uses": "aws-actions/configure-aws-credentials@v4",
1616
"with": {
1717
"aws-region": "ap-northeast-1",
1818
"role-skip-session-tagging": true,
@@ -21,11 +21,11 @@
2121
},
2222
{
2323
"id": "login-ecr",
24-
"uses": "aws-actions/amazon-ecr-login@v1"
24+
"uses": "aws-actions/amazon-ecr-login@v2"
2525
},
2626
{
2727
"id": "build-push",
28-
"uses": "docker/build-push-action@v3",
28+
"uses": "docker/build-push-action@v6",
2929
"with": {
3030
"context": "{{defaultContext}}:unbound",
3131
"outputs": "type=image,\"name=${{ steps.login-ecr.outputs.registry }}/unbound\",push-by-digest=true,name-canonical=true,push=true",
@@ -38,10 +38,11 @@
3838
"PLATFORM": "${{ matrix.key }}",
3939
"RUNNER_TEMP": "${{ runner.temp }}"
4040
},
41-
"name": "Export digest",
41+
"name": "Export digests",
4242
"run": "mkdir -p \"${RUNNER_TEMP}/digests\"\nprintenv DIGEST > \"${RUNNER_TEMP}/digests/${PLATFORM}\"\n"
4343
},
4444
{
45+
"name": "Upload digests",
4546
"uses": "actions/upload-artifact@v4",
4647
"with": {
4748
"if-no-files-found": "error",
@@ -73,10 +74,10 @@
7374
"runs-on": "ubuntu-latest",
7475
"steps": [
7576
{
76-
"uses": "docker/setup-buildx-action@v2"
77+
"uses": "docker/setup-buildx-action@v3"
7778
},
7879
{
79-
"uses": "aws-actions/configure-aws-credentials@v1",
80+
"uses": "aws-actions/configure-aws-credentials@v4",
8081
"with": {
8182
"aws-region": "ap-northeast-1",
8283
"role-skip-session-tagging": true,
@@ -85,9 +86,10 @@
8586
},
8687
{
8788
"id": "login-ecr",
88-
"uses": "aws-actions/amazon-ecr-login@v1"
89+
"uses": "aws-actions/amazon-ecr-login@v2"
8990
},
9091
{
92+
"name": "Download digests",
9193
"uses": "actions/download-artifact@v4",
9294
"with": {
9395
"merge-multiple": true,
@@ -98,10 +100,11 @@
98100
{
99101
"env": {
100102
"REPO": "${{ steps.login-ecr.outputs.registry }}/unbound",
103+
"RUNNER_TEMP": "${{ runner.temp }}",
101104
"SHA": "${{ github.sha }}"
102105
},
103106
"name": "Push manifest",
104-
"run": "cat * | xargs -I{} printf \"%s@%s\" \"${REPO}\" {} | docker buildx imagetools create -f /dev/stdin -t \"${REPO}:latest\" -t \"${REPO}:${SHA}\"\ndocker buildx imagetools inspect \"${REPO}:${SHA}\"\n"
107+
"run": "cat \"${RUNNER_TEMP}\"/digests/* | xargs -I{} printf \"%s@%s\" \"${REPO}\" {} | docker buildx imagetools create -f /dev/stdin -t \"${REPO}:latest\" -t \"${REPO}:${SHA}\"\ndocker buildx imagetools inspect \"${REPO}:${SHA}\"\n"
105108
}
106109
]
107110
}

0 commit comments

Comments
 (0)