-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (55 loc) · 1.56 KB
/
main.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
51
52
53
54
55
56
57
58
59
60
61
62
---
name: Determine the Docker 'tags' to use, then invoke the build/test/publish workflow.
on:
push:
branches:
- '*'
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- '*'
env:
TAG_PREFIX: prefix # must be lower case
jobs:
tests:
uses: "./.github/workflows/test.yml"
get-tags:
runs-on: ubuntu-latest
needs: [tests]
steps:
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.TAG_PREFIX }} # dummy value since blank is not allowed
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}} # major.minor.patch
type=semver,pattern={{major}}.{{minor}}
- name: Remove dummy prefix
id: removed
run: |
# comma separated list of tags
reference_list=${{ steps.meta.outputs.tags }}
prefix_to_remove=${{ env.TAG_PREFIX }}:
# remove prefix, e.g., ->"prefix:tag1,prefix:tag2"->"tag1,tag2"
tags=${reference_list//$prefix_to_remove/}
echo "tags=$tags" >> $GITHUB_ENV
outputs:
tags: ${{ env.tags }}
docker-build-push:
if: ${{ github.event_name == 'push' }}
needs: [get-tags]
uses: "./.github/workflows/docker_build_push.yml"
strategy:
matrix:
notebook_type:
- jupyter
- rstudio
secrets: inherit
with:
TAGS: ${{ needs.get-tags.outputs.tags }}
NOTEBOOK_TYPE: ${{ matrix.notebook_type }}
...