Skip to content

Commit

Permalink
Build images once and push to both GHCR & Docker Hub (lloesche#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCatLady authored Sep 30, 2021
1 parent 777f2be commit 1715a87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 55 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
Expand All @@ -46,7 +53,9 @@ jobs:
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
build-args: SOURCE_COMMIT=${{ github.sha }}
tags: ghcr.io/lloesche/valheim-server:latest
tags: |
ghcr.io/lloesche/valheim-server:latest
lloesche/valheim-server:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/dockerhub-build.yml

This file was deleted.

0 comments on commit 1715a87

Please sign in to comment.