summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFinlay Davidson <finlay.davidson@coderclass.nl>2022-06-26 23:19:23 +0200
committerJF <JF002@users.noreply.github.com>2022-07-08 17:13:47 +0200
commit1b971eebaead49dc9c40e309c9fce127eaaff98a (patch)
treefdcf4e2bfc86135873999fbd5a91a2e847f7c491 /.github
parent6a0aec08501bcd1b3abe35ba9db9d6618e5b4b28 (diff)
Don't try to cache to Docker Hub on pull request
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docker.yml14
1 files changed, 13 insertions, 1 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index d4669206..0ad1adb5 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -32,13 +32,25 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Build and push
+ if: github.event_name == 'push'
uses: docker/build-push-action@v3
with:
context: ./docker/
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
builder: ${{ steps.buildx.outputs.name }}
- push: ${{ github.event_name == 'push' }}
+ push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:latest
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache,mode=max
+
+ - name: Build
+ if: github.event_name != 'push'
+ uses: docker/build-push-action@v3
+ with:
+ context: ./docker/
+ file: ./docker/Dockerfile
+ platforms: linux/amd64,linux/arm64
+ builder: ${{ steps.buildx.outputs.name }}
+ push: false
+ cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache