-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (67 loc) · 1.93 KB
/
build-incus-image.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
name: Build Incus image
on:
workflow_dispatch:
env:
os: mageia
jobs:
clean_stale_repo:
name: Clean stale repo
runs-on: self-hosted
steps:
- name: Clean stale repo
run: sudo rm -rf .* * || true
clone_repo:
name: Clone repo
runs-on: self-hosted
needs: clean_stale_repo
steps:
- name: Clone repo
uses: actions/checkout@v4
craft_minimal_system:
name: Craft minimal system
runs-on: self-hosted
needs: clone_repo
steps:
- name: Cache squash-fs
id: squash-fs
uses: actions/cache@v4
with:
path: ${{ env.os }}.sqfs
key: ${{ env.os }}.sqfs-${{ hashFiles('./Makefile') }}
- name: Make 'minimal-fs'
if: steps.squash-fs.outputs.cache-hit != 'true'
run: make minimal-fs
- name: Make 'squash-fs'
if: steps.squash-fs.outputs.cache-hit != 'true'
run: make squash-fs
- name: Upload image
uses: actions/upload-artifact@v4
with:
name: ${{ env.os }}.sqfs
path: ${{ env.os }}.sqfs
build_for_target:
name: Build for target
runs-on: self-hosted
needs: craft_minimal_system
steps:
- name: Cache build
id: build
uses: actions/cache@v4
with:
#path: ./out/disk.qcow2
path: ./out/{{ env.os }}.tar.xz
key: image-${{ env.os }}-incus-${{ hashFiles('*.sqfs', '*.yaml') }}
- name: Make target 'build-incus'
if: steps.build.outputs.cache-hit != 'true'
run: make build-incus
- name: Upload image
uses: actions/upload-artifact@v4
with:
name: image-${{ env.os }}-incus
#path: ./out/disk.qcow2
path: ./out/{{ env.os }}.tar.xz
# - name: Upload metadata
# uses: actions/upload-artifact@v4
# with:
# name: image-${{ env.os }}-incus-meta
# path: ./out/incus.tar.xz