Skip to content

Build Alpine ZFS Netboot Image #1403

Build Alpine ZFS Netboot Image

Build Alpine ZFS Netboot Image #1403

name: Build Alpine ZFS Netboot Image
on:
push:
branches:
- main
schedule:
- cron: '0 */1 * * *'
workflow_dispatch:
inputs:
branch:
description: "Optional branch name to checkout"
required: false
default: "main"
jobs:
build-alpine-zfs-netboot-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Build alpine image
run: |
podman run -it --rm -v $(pwd):/root/workdir alpine sh /root/workdir/build-alpine-netboot-zfs.sh
- name: Patch alpine image
run: |
./patch-alpine-netboot-image-with-zfs.sh
- name: Setting up SSH key to publish netboot image
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BOOT_SERVER_SSH_PRIVATE_KEY }}
- name: scp netboot image to boot server
run: |
scp -o StrictHostKeyChecking=no iso/alpine-zfsnetboot.tar.gz ${{ secrets.BOOT_SERVER_SSH_USERNAME }}@${{ secrets.BOOT_SERVER_IP_ADDRESS }}:${{ secrets.BOOT_SERVER_IMG_DEST_DIR }}
- name: extract netboot image on boot server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.BOOT_SERVER_SSH_USERNAME }}@${{ secrets.BOOT_SERVER_IP_ADDRESS }} -C 'cd ${{ secrets.BOOT_SERVER_IMG_DEST_DIR }} && tar xvf alpine-zfsnetboot.tar.gz'
- name: Publish alpine netboot image artifact
uses: actions/upload-artifact@v4
with:
name: alpine-zfs-netboot-image
path: iso/alpine-zfsnetboot.tar.gz