fix periodic workflow (#18) #59
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: 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 }} | |
... |