-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Use official Docker GitHub Action for publication to Docker Hub (#…
…808) * Use official Docker GitHub Action to publish to Docker Hub - Tag image with version release and 'latest-stable' tags if the push is a tag release
- Loading branch information
1 parent
ad76571
commit 26c8887
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish Docker Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and publish Docker images to Docker Hub | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- name: Build and Publish to Registry | ||
if: "! ${{ startsWith(github.ref, 'refs/tags/') }}" | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
repository: pyhf/pyhf | ||
dockerfile: docker/Dockerfile | ||
tags: latest | ||
- name: Build and Publish to Registry with Release Tag | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
repository: pyhf/pyhf | ||
dockerfile: docker/Dockerfile | ||
tags: latest,latest-stable | ||
tag_with_ref: true |