Skip to content

Commit

Permalink
Build Docker image only on new release
Browse files Browse the repository at this point in the history
  • Loading branch information
msoap committed Oct 10, 2021
1 parent 8c6ec05 commit 8dc1b15
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Publish Docker image

on:
push:
branches: [ master ]
release:
types: [ published ]
tags:
- 'v*'

jobs:
push_to_registry:
Expand Down Expand Up @@ -35,18 +34,10 @@ jobs:

- name: Push to Docker Hub
uses: docker/build-push-action@v2
if: ${{ github.event_name == 'push' }}
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/shell2http:latest

- name: Push Tag to Docker Hub
uses: docker/build-push-action@v2
if: ${{ github.event_name == 'release' }}
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/shell2http:${{ steps.get_git_tag.outputs.GIT_TAG }}
tags: |
msoap/shell2http:latest
msoap/shell2http:${{ steps.get_git_tag.outputs.GIT_TAG }}

0 comments on commit 8dc1b15

Please sign in to comment.