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 <jkneubuh@us.ibm.com>
  • Loading branch information
jkneubuh authored and denyeart committed Dec 15, 2022
1 parent 43ab01e commit 2944542
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
GO_VER: 1.18.7
ALPINE_VER: 3.16
FABRIC_VER: ${{ github.ref_name }}
DOCKER_REGISTRY: ghcr.io
DOCKER_REGISTRY: docker.io # or ghcr.io

permissions:
contents: read
Expand Down Expand Up @@ -97,16 +97,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Login to the GitHub Container Registry
- name: Login to the ${{ env.DOCKER_REGISTRY }} Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# For the docker hub registry:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ contains(env.DOCKER_REGISTRY, 'docker.io') && secrets.DOCKERHUB_USERNAME || github.actor }}
password: ${{ contains(env.DOCKER_REGISTRY, 'docker.io') && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
Expand Down

0 comments on commit 2944542

Please sign in to comment.