optionally push to DockerHub

This commit is contained in:
mauwii 2023-02-07 04:58:44 +01:00 committed by Matthias Wild
parent 59486615dd
commit c52d11b24c

View File

@ -39,7 +39,9 @@ jobs:
uses: docker/metadata-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
images: ghcr.io/${{ github.repository }}
images: |
ghcr.io/${{ github.repository }}
${{ vars.DOCKER_HUB }}
tags: |
type=ref,event=branch
type=ref,event=tag
@ -66,6 +68,13 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
if: github.event_name != 'pull_request' && vars.DOCKER_HUB != ''
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build container
id: docker_build
uses: docker/build-push-action@v4