Skip to content

Commit

Permalink
User docker build actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jriggins committed Nov 16, 2021
1 parent 99b4fb6 commit 46b026d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
- name: Checkout
uses: actions/checkout@v2

- name: Get Docker Metadata
Expand All @@ -23,13 +23,19 @@ jobs:
with:
images: ${{ env.DOCKER_TAG_IMAGE }}

- name: Build Docker Image
run: |
docker build -t ${{ steps.meta.outputs.tags }} -f Dockerfile .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Push to Container Registry
if: github.event_name != 'pull_request'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login -u ${{ github.actor }} https://ghcr.io --password-stdin
docker push ${{ steps.meta.outputs.tags }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Image and Push to Conainer Registry (if master or tag)
id: docker_build
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 46b026d

Please sign in to comment.