Merge pull request #267 from sbe-arg/fix/github-login

fix: docker cache to github registry mistake
This commit is contained in:
jokob-sk
2023-06-24 19:43:08 +10:00
committed by GitHub
2 changed files with 18 additions and 4 deletions

View File

@@ -51,6 +51,13 @@ jobs:
type=semver,pattern={{major}}
type=sha
- name: Log in to Github Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
@@ -66,5 +73,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=docker.io/jokobsk/pi.alert:buildcache
cache-to: type=registry,ref=docker.io/jokobsk/pi.alert:buildcache,mode=max
cache-from: type=registry,ref=ghcr.io/jokobsk/pi.alert:buildcache
cache-to: type=registry,ref=ghcr.io/jokobsk/pi.alert:buildcache,mode=max

View File

@@ -58,6 +58,13 @@ jobs:
type=ref,event=pr
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
- name: Log in to Github Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
@@ -73,5 +80,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=docker.io/jokobsk/pi.alert:buildcache
cache-to: type=registry,ref=docker.io/jokobsk/pi.alert:buildcache,mode=max
cache-from: type=registry,ref=ghcr.io/jokobsk/pi.alert:buildcache
cache-to: type=registry,ref=ghcr.io/jokobsk/pi.alert:buildcache,mode=max