Skip to content

Commit

Permalink
- Only push to dockerhub for tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaellh0079 committed Dec 4, 2023
1 parent 770864b commit 1b82dc2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/push-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Push To Docker hub
on:
push:
tags:
- v*
- v*
branches:
- master

jobs:
push_to_registry:
Expand All @@ -16,18 +18,18 @@ jobs:
- name: Get tag version
id: tag_name
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
push: contains(github.ref, 'tags')
tags: ghrcdaac/dmrpp-generator:${{ steps.tag_name.outputs.SOURCE_TAG }}

- name: Extract coverage report
Expand Down

0 comments on commit 1b82dc2

Please sign in to comment.