Skip to content

Bump crontab from 1.0.1 to 1.0.4 #160

Bump crontab from 1.0.1 to 1.0.4

Bump crontab from 1.0.1 to 1.0.4 #160

name: Build Changed Container Images
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
generate-changed-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
name: pulling the branch
with:
fetch-depth: 50
- name: Get Changes
id: changes
uses: jitterbit/get-changed-files@v1
with:
format: 'json'
- name: Storing changed/removed files listings
id: matrix
run: |
set -x
jq -rc '{"images": [ (.[] | select(test("^[a-zA-Z0-9_-]*\/")) | split("/") | .[0])] | sort | unique }' <<<'${{ steps.changes.outputs.added_modified }}' >> images.list
echo "List of images:"
cat images.list
if [ "$(jq '.images | length' images.list)" == "0" ]; then
echo "empty=true" >> $GITHUB_OUTPUT
else
echo "empty=false" >> $GITHUB_OUTPUT
fi
echo "matrix=$(cat images.list)" >> $GITHUB_OUTPUT
- name: Cancelling for empty matrix
if: ${{ steps.matrix.outputs.empty == 'true' }}
uses: andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1
build-images:
needs: generate-changed-matrix
strategy:
matrix: ${{fromJson( needs.generate-changed-matrix.outputs.matrix )}}
fail-fast: false
uses: ./.github/workflows/build-image.yaml
with:
image-name: ${{matrix.images}}
push: ${{ github.event_name == 'push' }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}