🤖 Add CI pipelines

Signed-off-by: mudler <mudler@mocaccino.org>
This commit is contained in:
mudler 2022-11-25 17:16:02 +01:00
parent be14d943bf
commit 17346e3e7e
4 changed files with 68 additions and 1 deletions

35
.github/workflows/image.yaml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Build image
on:
push:
branches:
- main
pull_request:
concurrency:
group: ci-image-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write # OIDC support
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- name: setup-docker
uses: docker-practice/actions-setup-docker@master
- name: Build 🔧
run: |
./earthly.sh +iso
- uses: actions/upload-artifact@v2
with:
name: ipxe-artifacts.zip
path: |
build/*
if-no-files-found: error

29
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write # OIDC support
contents: write
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- name: setup-docker
uses: docker-practice/actions-setup-docker@master
- name: Build 🔧
run: |
./earthly.sh +iso
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/*

View File

@ -20,7 +20,7 @@ iso:
mtools syslinux isolinux gcc-arm-none-eabi git make gcc liblzma-dev mkisofs xorriso
# jq docker
WORKDIR /build
ARG ISO_NAME=${OS_ID}
ARG ISO_NAME=ipxe-dhcp
COPY +version/VERSION ./
ARG VERSION=$(cat VERSION)

3
earthly.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock --rm -t -v $(pwd):/workspace -v earthly-tmp:/tmp/earthly:rw earthly/earthly:v0.6.21 --allow-privileged $@