-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.35 KB
/
publish_docker_on_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 }}