@@ -3,54 +3,43 @@ name: Docker image
33on : push
44jobs :
55 build_push_api :
6- name : Build and push execution environment
6+ name : Build and push image
77 runs-on : ubuntu-latest
8+ permissions :
9+ contents : read
10+ id-token : write # needed for signing the images with GitHub OIDC Token
11+ packages : write # required for pushing container images
12+ security-events : write # required for pushing SARIF files
13+
814 steps :
915 - name : Check out the repository
10- uses : actions/checkout@v2
11-
12- - name : Set up Docker Buildx
13- uses : docker/setup-buildx-action@v1
16+ uses : actions/checkout@v4
1417
15- - name : Set up Docker layer caching
16- uses : actions/cache@v2
17- with :
18- path : /tmp/.buildx-cache
19- key : ${{ runner.os }}-buildx-${{ github.sha }}
20- restore-keys : |
21- ${{ runner.os }}-buildx-
2218 - name : Login to GitHub Container Registry
23- uses : docker/login-action@v1
19+ uses : docker/login-action@v3
2420 with :
2521 registry : ghcr.io
2622 username : ${{ github.actor }}
2723 password : ${{ secrets.GITHUB_TOKEN }}
2824
2925 - name : Calculate metadata for image
3026 id : image-meta
31- uses : docker/metadata-action@v3
27+ uses : docker/metadata-action@v5
3228 with :
3329 images : ghcr.io/stackhpc/os-capacity
3430 # Produce the branch name or tag and the SHA as tags
3531 tags : |
3632 type=ref,event=branch
3733 type=ref,event=tag
3834 type=sha,prefix=
35+
3936 - name : Build and push image
40- uses : docker/ build-push-action@v2
37+ uses : azimuth-cloud/github-actions/docker-multiarch- build-push@master
4138 with :
39+ cache-key : os-capacity
4240 context : .
41+ platforms : linux/amd64,linux/arm64
4342 push : true
4443 tags : ${{ steps.image-meta.outputs.tags }}
4544 labels : ${{ steps.image-meta.outputs.labels }}
46- cache-from : type=local,src=/tmp/.buildx-cache
47- cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
48-
49- # Temp fix
50- # https://github.com/docker/build-push-action/issues/252
51- # https://github.com/moby/buildkit/issues/1896
52- # https://github.com/docker/buildx/pull/535
53- - name : Move cache
54- run : |
55- rm -rf /tmp/.buildx-cache
56- mv /tmp/.buildx-cache-new /tmp/.buildx-cache
45+ github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments