Skip to content

Monthly Docker Pull Validation #17

Monthly Docker Pull Validation

Monthly Docker Pull Validation #17

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 }}