Skip to content
name: Build Custom Images on Push to Branch
on:
push:
branches:
- '!master'
paths:
- 'custom-images/**'
- '.github/workflows/custom-containers-run-ci.yaml'
- '!custom-images/docs/**'
jobs:
generate-matrix-from-changed-files:
runs-on: ubuntu-latest
outputs:
changed_directories: ${{ steps.set-output.outputs.changed_directories }}
steps:
- uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42.0.7
with:
dir_names: true
json: true
quotepath: false
dir_names_exclude_current_dir: true
files: |
custom-images/**
!custom-images/docs/**
- name: 'Set output in the matrix format'
id: set-output
run: echo "changed_directories={\"dir\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
build-and-publish:
runs-on: ubuntu-latest
if: ${{ needs.generate-matrix-from-changed-files.outputs.changed_directories != '' }}
strategy:
matrix: ${{fromJson(needs.generate-matrix-from-changed-files.outputs.changed_directories)}}
needs:
- generate-matrix-from-changed-files
steps:
- name: Get current branch
id: get-branch
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Build and Publish
uses: AidanHilt/PersonalMonorepo/.github/workflows/custom-containers-base.yaml@feat/reworked-ci