-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.44 KB
/
make.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
name: Make
on:
release:
types: [published]
push:
branches:
- '**'
tags-ignore:
- '**'
schedule:
- cron: '0 4 5,25 * *'
jobs:
configure-workflow:
name: Configure workflow
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
matrix: ${{ steps.list-flavors.outputs.matrix }}
steps:
- id: skip_check
name: Configure skip-duplicate-actions
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '["**/README.md"]'
do_not_skip: '["workflow_dispatch", "schedule", "release"]'
- uses: actions/checkout@v4
- id: list-flavors
name: List flavors
run: |
matrix=$(find ./flavors -mindepth 2 -maxdepth 2 -name 'flavor_config.yaml' | xargs yq ea -o=j -I=0 '[.]')
echo "matrix={\"include\":$(echo $matrix)}" | tee -a $GITHUB_OUTPUT
flavors:
name: Flavor ${{ matrix.flavor_name }}
uses: ./.github/workflows/make-flavor.yaml
needs: [configure-workflow]
if: needs.configure-workflow.outputs.should_skip != 'true'
with:
flavor_name: ${{ matrix.flavor_name }}
image_repo: 'ghcr.io/qcdis/naavre'
image_version: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
naavre_version: 'v2.4.3'
build_jupyter: ${{ matrix.build_jupyter }}
free_disk_space: ${{ matrix.free_disk_space }}
strategy:
matrix: ${{ fromJson(needs.configure-workflow.outputs.matrix) }}
save-base-image-tags:
name: Save base image tags
runs-on: ubuntu-latest
needs: [flavors]
if: ${{ github.event_name == 'release' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Generate base_image_tags.json
run: |
find ./flavors -mindepth 2 -maxdepth 2 -name 'flavor_config.yaml' | \
xargs yq ea -o=j '[.] | map({"key": .flavor_name, "value": {"build": "ghcr.io/qcdis/naavre/naavre-cell-build-" + .flavor_name + ":${{ github.ref_name }}", "runtime": "ghcr.io/qcdis/naavre/naavre-cell-runtime-" + .flavor_name + ":${{ github.ref_name }}"}}) | from_entries' \
| tee /tmp/base_image_tags.json
- name: Add base_image_tags.json to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /tmp/base_image_tags.json
asset_name: base_image_tags.json
tag: ${{ github.ref }}