Skip to content

Commit

Permalink
Conditionally publish docker images to docker.io
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Kneubuhl <[email protected]>
  • Loading branch information
jkneubuh authored and denyeart committed Dec 15, 2022
1 parent 18d7c89 commit 563b5b8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
GO_VER: 1.18.8
ALPINE_VER: 3.17
REGISTRY: ghcr.io
REGISTRY: docker.io # or ghcr.io
IMAGE_NAME: ${{ github.repository }}

permissions:
Expand Down Expand Up @@ -75,15 +75,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Login to the GitHub Container Registry
- name: Login to the ${{ env.REGISTRY }} Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# registry: docker.io
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ contains(env.REGISTRY, 'docker.io') && secrets.DOCKERHUB_USERNAME || github.actor }}
password: ${{ contains(env.REGISTRY, 'docker.io') && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
Expand Down

0 comments on commit 563b5b8

Please sign in to comment.