-
Notifications
You must be signed in to change notification settings - Fork 71
78 lines (70 loc) · 2.55 KB
/
clp-execution-image-build.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: "clp-execution-image-build"
on:
pull_request:
paths:
- ".github/actions/clp-execution-image-build/action.yaml"
- ".github/workflows/clp-execution-image-build.yaml"
- "tools/docker-images/**"
push:
paths:
- ".github/actions/clp-execution-image-build/action.yaml"
- ".github/workflows/clp-execution-image-build.yaml"
- "tools/docker-images/**"
workflow_dispatch:
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
# Cancel in-progress jobs for efficiency
cancel-in-progress: true
jobs:
filter-relevant-changes:
runs-on: "ubuntu-latest"
outputs:
ubuntu_focal_image_changed: "${{steps.filter.outputs.ubuntu_focal_image}}"
ubuntu_jammy_image_changed: "${{steps.filter.outputs.ubuntu_jammy_image}}"
steps:
- uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"
- name: "Filter relevant changes"
uses: "dorny/paths-filter@v2"
id: "filter"
with:
base: "main"
filters: |
ubuntu_focal_image:
- ".github/actions/**"
- ".github/workflows/clp-execution-image-build.yaml"
- "tools/docker-images/clp-execution-base-ubuntu-focal/**"
ubuntu_jammy_image:
- ".github/actions/**"
- ".github/workflows/clp-execution-image-build.yaml"
- "tools/docker-images/clp-execution-base-ubuntu-jammy/**"
build-image:
needs: "filter-relevant-changes"
runs-on: "ubuntu-latest"
strategy:
matrix:
include:
- platform_version_id: "focal"
condition: "needs.filter-relevant-changes.outputs.ubuntu_focal_image_changed"
- platform_version_id: "jammy"
condition: "needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed"
steps:
- uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Workaround actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"
- name: "Build and Push Docker Image"
if: "'true' == matrix.condition"
uses: "./.github/actions/clp-execution-image-build"
with:
image_registry: "ghcr.io"
image_registry_username: "${{github.actor}}"
image_registry_password: "${{secrets.GITHUB_TOKEN}}"
platform_id: "ubuntu"
platform_version_id: "${{matrix.platform_version_id}}"