Skip to content

Publish Docker

Publish Docker #22

name: Publish Docker
on:
workflow_run:
workflows: ["Publish PyPI"]
types: [completed]
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 }}