@@ -3,54 +3,43 @@ name: Docker image
3
3
on : push
4
4
jobs :
5
5
build_push_api :
6
- name : Build and push execution environment
6
+ name : Build and push image
7
7
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
+
8
14
steps :
9
15
- 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
14
17
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-
22
18
- name : Login to GitHub Container Registry
23
- uses : docker/login-action@v1
19
+ uses : docker/login-action@v3
24
20
with :
25
21
registry : ghcr.io
26
22
username : ${{ github.actor }}
27
23
password : ${{ secrets.GITHUB_TOKEN }}
28
24
29
25
- name : Calculate metadata for image
30
26
id : image-meta
31
- uses : docker/metadata-action@v3
27
+ uses : docker/metadata-action@v5
32
28
with :
33
29
images : ghcr.io/stackhpc/os-capacity
34
30
# Produce the branch name or tag and the SHA as tags
35
31
tags : |
36
32
type=ref,event=branch
37
33
type=ref,event=tag
38
34
type=sha,prefix=
35
+
39
36
- name : Build and push image
40
- uses : docker/ build-push-action@v2
37
+ uses : azimuth-cloud/github-actions/docker-multiarch- build-push@master
41
38
with :
39
+ cache-key : os-capacity
42
40
context : .
41
+ platforms : linux/amd64,linux/arm64
43
42
push : true
44
43
tags : ${{ steps.image-meta.outputs.tags }}
45
44
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