Build Incus image #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |