Skip to content

Commit

Permalink
ci: Use official Docker GitHub Action for publication to Docker Hub (#…
Browse files Browse the repository at this point in the history
…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
matthewfeickert authored Mar 19, 2020
1 parent ad76571 commit 26c8887
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish-docker.yml
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

0 comments on commit 26c8887

Please sign in to comment.