11
11
steps :
12
12
13
13
- name : Checkout
14
- uses : actions/checkout@v2
14
+ uses : actions/checkout@v4
15
15
16
16
# Parse the ref to get the clean tag name.
17
17
- id : get_version
@@ -20,33 +20,24 @@ jobs:
20
20
21
21
# Setup qEMU for arm64
22
22
- name : Set up QEMU
23
- uses : docker/setup-qemu-action@v1
23
+ uses : docker/setup-qemu-action@v3
24
24
with :
25
25
platforms : arm64
26
26
27
27
# We use buildx instead of regular build so we can take advantage of Docker layer cache via GithubActions's cache
28
28
# Also buildx offers multi-arch builds
29
29
- name : Set up Docker Buildx
30
30
id : buildx
31
- uses : docker/setup-buildx-action@v1
32
-
33
- # Setup the Github Actions cache.
34
- - name : Cache Docker layers
35
- uses : actions/cache@v2
36
- with :
37
- path : /tmp/.buildx-cache
38
- key : ${{ runner.os }}-buildxarch-${{ github.sha }}
39
- restore-keys : |
40
- ${{ runner.os }}-buildxarch-
31
+ uses : docker/setup-buildx-action@v3
41
32
42
33
- name : Docker Login to DockerHub
43
- uses : docker/login-action@v1
34
+ uses : docker/login-action@v3
44
35
with :
45
36
username : ${{ secrets.DOCKER_HUB_USERNAME }}
46
37
password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
47
38
48
39
- name : Docker Login to GitHub Container Registry
49
- uses : docker/login-action@v1
40
+ uses : docker/login-action@v3
50
41
with :
51
42
registry : ghcr.io
52
43
username : ${{ github.repository_owner }} # github username or org
57
48
# could result in pull failures or inconsistencies for arm64, such is life.
58
49
# further duplicated by building both release and debug builds
59
50
- name : Build and push amd64 Release Docker Image to DockerHub/GitHub CR
60
- uses : docker/build-push-action@v2
51
+ uses : docker/build-push-action@v6
61
52
with :
62
53
build-args : |
63
54
DEBUG_BUILD=0
@@ -66,13 +57,11 @@ jobs:
66
57
context : .
67
58
file : ./Dockerfile
68
59
platforms : linux/amd64
69
- tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }},ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}
60
+ tags : rpardini/docker-registry-proxy:amd64- ${{ steps.get_version.outputs.version }},ghcr.io/rpardini/docker-registry-proxy:amd64- ${{ steps.get_version.outputs.version }}
70
61
push : true
71
- cache-from : type=local,src=/tmp/.buildx-cache/release
72
- # first run does not export the cache
73
62
74
63
- name : Build and push amd64 Debug Docker Image to DockerHub/GitHub CR
75
- uses : docker/build-push-action@v2
64
+ uses : docker/build-push-action@v6
76
65
with :
77
66
build-args : |
78
67
DEBUG_BUILD=1
@@ -81,15 +70,13 @@ jobs:
81
70
context : .
82
71
file : ./Dockerfile
83
72
platforms : linux/amd64
84
- tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug,ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug
73
+ tags : rpardini/docker-registry-proxy:amd64- ${{ steps.get_version.outputs.version }}-debug,ghcr.io/rpardini/docker-registry-proxy:amd64- ${{ steps.get_version.outputs.version }}-debug
85
74
push : true
86
- cache-from : type=local,src=/tmp/.buildx-cache/debug
87
- # first run does not export the cache
88
75
89
76
# Do it all again with both archs. the amd64 will be a huge cache hit
90
77
# this will update the manifest have both arches
91
78
- name : Build and push multiarch Release Docker Image to DockerHub/GitHub CR
92
- uses : docker/build-push-action@v2
79
+ uses : docker/build-push-action@v6
93
80
with :
94
81
build-args : |
95
82
DEBUG_BUILD=0
@@ -100,11 +87,9 @@ jobs:
100
87
platforms : linux/arm64,linux/amd64
101
88
tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }},ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}
102
89
push : true
103
- cache-from : type=local,src=/tmp/.buildx-cache/release
104
- cache-to : type=local,mode=max,dest=/tmp/.buildx-cache/release
105
90
106
91
- name : Build and push multiarch Debug Docker Image to DockerHub/GitHub CR
107
- uses : docker/build-push-action@v2
92
+ uses : docker/build-push-action@v6
108
93
with :
109
94
build-args : |
110
95
DEBUG_BUILD=1
@@ -115,6 +100,4 @@ jobs:
115
100
platforms : linux/arm64,linux/amd64
116
101
tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug,ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug
117
102
push : true
118
- cache-from : type=local,src=/tmp/.buildx-cache/debug
119
- cache-to : type=local,mode=max,dest=/tmp/.buildx-cache/debug
120
103
0 commit comments