From 94f7c8ee2be787f405253f9a28a39049aee0f606 Mon Sep 17 00:00:00 2001 From: Oded Ben-Ozer Date: Wed, 8 Feb 2023 14:05:31 +0100 Subject: [PATCH 1/2] Publish container images to Docker Hub also --- .github/workflows/docker-publish.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a2ff1275..43111016 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,7 +53,7 @@ jobs: # Login against a Docker registry except on PR # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} + - name: Log into GH registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139 with: @@ -61,13 +61,22 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Log into Docker Hub registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta uses: docker/metadata-action@766400ca14a75010e7b2e3119aa0d5b46826e8c7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + obenozer412/${{ env.IMAGE_NAME }} #Docker Hub registery # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action From 83f18f522e4161d963c0d0c627ec73264adcc457 Mon Sep 17 00:00:00 2001 From: Oded Ben-Ozer Date: Wed, 8 Feb 2023 14:08:08 +0100 Subject: [PATCH 2/2] Move comment to avoid syntax issues --- .github/workflows/docker-publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 43111016..66154f69 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -70,13 +70,16 @@ jobs: # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action + # 1st image name is for GH package repo + # 2nd image name is for DockerHub image - name: Extract Docker metadata id: meta uses: docker/metadata-action@766400ca14a75010e7b2e3119aa0d5b46826e8c7 with: images: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - obenozer412/${{ env.IMAGE_NAME }} #Docker Hub registery + obenozer412/${{ env.IMAGE_NAME }} + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action