diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2e62f89..c8885ed 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,12 +32,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker - id: meta + id: meta-ghcr uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: - images: | - ${{ env.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }} - ${{ env.REGISTRY_DOCKERHUB }}/${{ github.actor }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image to GitHub @@ -45,8 +43,8 @@ jobs: with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-ghcr.outputs.tags }} + labels: ${{ steps.meta-ghcr.outputs.labels }} - name: Log in to DockerHub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 @@ -55,10 +53,16 @@ jobs: username: ${{ env.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASSWORD }} # You need to set this secret in your GitHub repository settings + - name: Extract metadata (tags, labels) for Docker + id: meta-dh + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY_DOCKERHUB }}/${{ github.actor }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image to DockerHub uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + tags: ${{ steps.meta-dh.outputs.tags }} + labels: ${{ steps.meta-dh.outputs.labels }} \ No newline at end of file