From c3bd04f4974a1c954278fa955dd71c8cf24a60a6 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Sun, 3 Jul 2022 21:42:23 +0200 Subject: [PATCH] Make Docker workflow push to latest and commit sha --- .github/workflows/docker.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0ad1adb5..b2905267 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,10 +25,21 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Set up Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build + tags: | + type=sha + type=raw,value=latest + - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v2 - name: Build and push @@ -40,7 +51,8 @@ jobs: platforms: linux/amd64,linux/arm64 builder: ${{ steps.buildx.outputs.name }} push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} 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