Skip to content

Commit

Permalink
Merge pull request #16 from wayfair-incubator/publish_to_docker_hub
Browse files Browse the repository at this point in the history
Publish container images to Docker Hub also
  • Loading branch information
Oded-B authored Feb 8, 2023
2 parents 13aa93f + 83f18f5 commit 157d4e0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,33 @@ 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:
registry: ${{ env.REGISTRY }}
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
# 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 }}
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
obenozer412/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand Down

0 comments on commit 157d4e0

Please sign in to comment.