Repository navigation
93 lines (82 loc) · 2.45 KB
/
Copy pathimage-pull.yaml
File metadata and controls
93 lines (82 loc) · 2.45 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Image Pull
on:
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
filter:
name: Image Pull - Filter
runs-on: ubuntu-latest
outputs:
changed-files: ${{ steps.changed-files.outputs.changed_files }}
steps:
- name: Get Changed Files
id: changed-files
uses: bjw-s-labs/action-changed-files@147be9638332cf68fd60714a610509d7a9360d60 # v0.7.0
with:
patterns: kubernetes/**/*
extract:
if: ${{ needs.filter.outputs.changed-files != '[]' }}
needs: filter
name: Image Pull - Extract Images
runs-on: ubuntu-latest
outputs:
images: ${{ steps.extract.outputs.images }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Mise
uses: jdx/mise-action@d5574b52816a478f9d4e6529a3f6ff17a8a36785 # v5.2.8
with:
cache: false
tool_versions: |
github:home-operations/flate 0.4.9
- name: Extract Images
id: extract
run: |
echo 'images<<EOF' >> $GITHUB_OUTPUT
flate diff images -p ./kubernetes/apps -o json >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
pull:
if: ${{ needs.extract.outputs.images != '[]' }}
needs: extract
name: Image Pull - Pull Images
runs-on: waifulabs
strategy:
matrix:
image: ${{ fromJSON(needs.extract.outputs.images) }}
max-parallel: 4
fail-fast: false
steps:
- name: Setup Mise
uses: jdx/mise-action@d5574b52816a478f9d4e6529a3f6ff17a8a36785 # v5.2.8
with:
cache: false
tool_versions: |
talosctl latest
- name: Pull Image
env:
IMAGE: ${{ matrix.image }}
run: talosctl --nodes "$NODE" image pull "$IMAGE"
success:
if: ${{ !cancelled() }}
needs: pull
name: Image Pull - Success
runs-on: ubuntu-latest
steps:
- name: Any jobs failed?
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- name: All jobs passed or skipped?
if: ${{ !(contains(needs.*.result, 'failure')) }}
env:
RESULTS: ${{ toJSON(needs.*.result) }}
run: echo "All jobs passed or skipped" && echo "$RESULTS"