Publish Docker #6
Workflow file for this run
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
name: Build and upload bonsai-prp to Docker on release | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout prp | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: 'docker.io' | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Wait for PyPI to publish package | |
run: sleep 60s | |
shell: bash | |
- name: Export tags to env | |
run: | | |
VERSION=$(head -2 prp/__version__.py | tail -1 | cut -d'"' -f2); | |
echo "PRP_TAG=${VERSION}" >> $GITHUB_ENV | |
echo "PRP_TAG_LATEST=latest" >> $GITHUB_ENV | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: clinicalgenomicslund/bonsai-prp | |
tags: | | |
type=raw,value=${{ env.PRP_TAG }} | |
type=raw,value=${{ env.PRP_TAG_LATEST }} | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }}, | |
labels: ${{ steps.meta.outputs.labels }} |