GitHub Actions: publish :latest and :latest-debug also to GitHub Container Registry

- DockerHub is ok, but will be ratelimited soon, so this could be a nice alternative
cache-manifests-tiers
Ricardo Pardini 2020-10-30 12:56:22 +01:00
parent 8524e376c1
commit eafedba51b
1 changed files with 10 additions and 3 deletions

View File

@ -26,12 +26,19 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-buildxarch- ${{ runner.os }}-buildxarch-
- name: Login to DockerHub - name: Docker Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_GITHUB_USERNAME }}
password: ${{ secrets.DOCKER_GITHUB_PAT }}
# the arm64 is of course much slower due to qemu, so build and push amd64 **first** # the arm64 is of course much slower due to qemu, so build and push amd64 **first**
# due to the way manifests work, the gap between this and the complete push below # due to the way manifests work, the gap between this and the complete push below
# could result in pull failures or inconsistencies for arm64, such is life. # could result in pull failures or inconsistencies for arm64, such is life.
@ -46,7 +53,7 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64 platforms: linux/amd64
tags: rpardini/docker-registry-proxy:latest tags: rpardini/docker-registry-proxy:latest,ghcr.io/rpardini/docker-registry-proxy:latest
push: true push: true
cache-from: type=local,src=/tmp/.buildx-cache/release cache-from: type=local,src=/tmp/.buildx-cache/release
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache/release cache-to: type=local,mode=max,dest=/tmp/.buildx-cache/release
@ -61,7 +68,7 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64 platforms: linux/amd64
tags: rpardini/docker-registry-proxy:latest-debug tags: rpardini/docker-registry-proxy:latest-debug,ghcr.io/rpardini/docker-registry-proxy:latest-debug
push: true push: true
cache-from: type=local,src=/tmp/.buildx-cache/debug cache-from: type=local,src=/tmp/.buildx-cache/debug
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache/debug cache-to: type=local,mode=max,dest=/tmp/.buildx-cache/debug