@@ -39,17 +39,24 @@ jobs:
39
39
restore-keys : |
40
40
${{ runner.os }}-buildxarch-
41
41
42
- - name : Login to DockerHub
42
+ - name : Docker Login to DockerHub
43
43
uses : docker/login-action@v1
44
44
with :
45
45
username : ${{ secrets.DOCKER_HUB_USERNAME }}
46
46
password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
47
47
48
+ - name : Docker Login to GitHub Container Registry
49
+ uses : docker/login-action@v1
50
+ with :
51
+ registry : ghcr.io
52
+ username : ${{ secrets.DOCKER_GITHUB_USERNAME }}
53
+ password : ${{ secrets.DOCKER_GITHUB_PAT }}
54
+
48
55
# the arm64 is of course much slower due to qemu, so build and push amd64 **first**
49
56
# due to the way manifests work, the gap between this and the complete push below
50
57
# could result in pull failures or inconsistencies for arm64, such is life.
51
58
# further duplicated by building both release and debug builds
52
- - name : Build and push amd64 Release Docker Image to DockerHub
59
+ - name : Build and push amd64 Release Docker Image to DockerHub/GitHub CR
53
60
uses : docker/build-push-action@v2
54
61
with :
55
62
build-args : |
@@ -59,12 +66,12 @@ jobs:
59
66
context : .
60
67
file : ./Dockerfile
61
68
platforms : linux/amd64
62
- tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}
69
+ tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }},ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}
63
70
push : true
64
71
cache-from : type=local,src=/tmp/.buildx-cache/release
65
72
# first run does not export the cache
66
73
67
- - name : Build and push amd64 Debug Docker Image to DockerHub
74
+ - name : Build and push amd64 Debug Docker Image to DockerHub/GitHub CR
68
75
uses : docker/build-push-action@v2
69
76
with :
70
77
build-args : |
@@ -74,14 +81,14 @@ jobs:
74
81
context : .
75
82
file : ./Dockerfile
76
83
platforms : linux/amd64
77
- tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug
84
+ tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug,ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug
78
85
push : true
79
86
cache-from : type=local,src=/tmp/.buildx-cache/debug
80
87
# first run does not export the cache
81
88
82
89
# Do it all again with both archs. the amd64 will be a huge cache hit
83
90
# this will update the manifest have both arches
84
- - name : Build and push multiarch Release Docker Image to DockerHub
91
+ - name : Build and push multiarch Release Docker Image to DockerHub/GitHub CR
85
92
uses : docker/build-push-action@v2
86
93
with :
87
94
build-args : |
@@ -91,12 +98,12 @@ jobs:
91
98
context : .
92
99
file : ./Dockerfile
93
100
platforms : linux/arm64,linux/amd64
94
- tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}
101
+ tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }},ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}
95
102
push : true
96
103
cache-from : type=local,src=/tmp/.buildx-cache/release
97
104
cache-to : type=local,mode=max,dest=/tmp/.buildx-cache/release
98
105
99
- - name : Build and push multiarch Debug Docker Image to DockerHub
106
+ - name : Build and push multiarch Debug Docker Image to DockerHub/GitHub CR
100
107
uses : docker/build-push-action@v2
101
108
with :
102
109
build-args : |
@@ -106,7 +113,7 @@ jobs:
106
113
context : .
107
114
file : ./Dockerfile
108
115
platforms : linux/arm64,linux/amd64
109
- tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug
116
+ tags : rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug,ghcr.io/rpardini/docker-registry-proxy:${{ steps.get_version.outputs.version }}-debug
110
117
push : true
111
118
cache-from : type=local,src=/tmp/.buildx-cache/debug
112
119
cache-to : type=local,mode=max,dest=/tmp/.buildx-cache/debug
0 commit comments