Monthly Docker Pull Validation #21
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: Monthly Docker Pull Validation | |
on: | |
schedule: | |
- cron: '57 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
get-dockerfiles: | |
name: Get Changed Dockerfiles Matrix | |
runs-on: ubuntu-22.04 | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- id: checkout | |
uses: actions/checkout@v3 | |
name: Checkout Repo | |
with: | |
fetch-depth: 0 | |
- id: set-matrix | |
name: Changed Dockerfiles String to Matrix | |
run: | | |
MATRIX=$(find * -name Dockerfile | xargs -I{} dirname {} | jq -Rrs 'split("\n") | map(select(. != "")) | map(rtrimstr("/Dockerfile")) | map({"path": ., "image": (. | split("/")[0] | ascii_downcase), "tag": (. | split("/")[1] // "latest")}) | @json') | |
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT | |
pull-dockerfiles: | |
name: Pull ${{ matrix.path }} | |
needs: get-dockerfiles | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJSON(needs.get-dockerfiles.outputs.matrix) }} | |
steps: | |
- id: docker-pull | |
name: Pull Docker Image | |
run: | | |
docker pull pgc-images.sbgenomics.com/${{ secrets.CAVATICA_USERNAME }}/${{ matrix.image }}:${{ matrix.tag }} |