-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.18 KB
/
detect-changes.yaml
File metadata and controls
52 lines (45 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Detect and Build Changed Directories
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
packages: write
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: |
**/Dockerfile
**/versions.yaml
dir_names: true
dir_names_max_depth: 1
dir_names_exclude_current_dir: true
matrix: true
- name: List all changed directories
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
build:
needs: detect-changes
if: needs.detect-changes.outputs.matrix != '[]'
strategy:
matrix:
directory: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
uses: ./.github/workflows/build-image.yaml
with:
directory: ${{ matrix.directory }}
secrets: inherit