Scheduled Packages Update #72
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: Scheduled Packages Update | |
on: | |
schedule: | |
- cron: '0 9 * * MON' | |
workflow_dispatch: | |
jobs: | |
list-dockerfiles: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.dockerfiles.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: dockerfiles | |
run: echo "matrix=$(ls dockerfiles/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT | |
ghcr: | |
runs-on: ubuntu-latest | |
needs: list-dockerfiles | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
image: ${{ fromJson(needs.list-dockerfiles.outputs.matrix) }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: GHCR Login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- id: image-tag # example output: "ghcr.io/kestra-io/dbt-snowflake:latest" | |
run: | | |
export IMAGE=$(basename ${{ matrix.image }} .Dockerfile) | |
echo "image_url=ghcr.io/kestra-io/$IMAGE:latest" >> $GITHUB_OUTPUT | |
echo "file=dockerfiles/${{ matrix.image }}" >> $GITHUB_OUTPUT | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
continue-on-error: true # avoid blocking other images | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.image-tag.outputs.image_url }} | |
file: ${{ steps.image-tag.outputs.file }} | |
platforms: linux/amd64,linux/arm64 |