Skip to content

Commit

Permalink
Push Docker images on release creation only
Browse files Browse the repository at this point in the history
  • Loading branch information
kereis committed Feb 24, 2021
1 parent 2bcbda4 commit c251592
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release Docker image

on:
release:
types: [created]
push:
tags:
- 'v*'
Expand Down Expand Up @@ -83,6 +85,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

- name: Build and publish image (arm32v7)
uses: docker/build-push-action@v2
Expand All @@ -94,6 +97,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta_arm32v7.outputs.tags }}
labels: ${{ steps.docker_meta_arm32v7.outputs.labels }}
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

- name: Build and publish image (arm64v8)
uses: docker/build-push-action@v2
Expand All @@ -105,6 +109,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta_arm64v8.outputs.tags }}
labels: ${{ steps.docker_meta_arm64v8.outputs.labels }}
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

release-alpine:
name: Release Alpine
Expand Down Expand Up @@ -183,6 +188,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

- name: Build and publish image (arm32v7)
uses: docker/build-push-action@v2
Expand All @@ -194,6 +200,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta_arm32v7.outputs.tags }}
labels: ${{ steps.docker_meta_arm32v7.outputs.labels }}
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

- name: Build and publish image (arm64v8)
uses: docker/build-push-action@v2
Expand All @@ -205,3 +212,4 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta_arm64v8.outputs.tags }}
labels: ${{ steps.docker_meta_arm64v8.outputs.labels }}
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

0 comments on commit c251592

Please sign in to comment.