Skip to content

feat: adds github workflow to create an ironic esp image #1

feat: adds github workflow to create an ironic esp image

feat: adds github workflow to create an ironic esp image #1

---
name: build-ironic-esp-image
on:
workflow_dispatch:
pull_request:
paths:
- 'ironic-images/**'
push:
branches:
- main
paths:
- 'ironic-images/**'
merge_group:
types: [checks_requested]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: sudo apt update && sudo apt install -y grub-efi-amd64-signed shim-signed mtools
- name: Create esp image
run: |
cp /usr/lib/shim/shimx64.efi.signed /tmp/bootx64.efi
cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed /tmp/grubx64.efi
dd if=/dev/zero of=/tmp/esp.img bs=4096 count=1024
mkfs.msdos -F 12 -n ESP_IMAGE /tmp/esp.img
mmd -i /tmp/esp.img EFI EFI/BOOT
mcopy -i /tmp/esp.img -v /tmp/bootx64.efi ::EFI/BOOT/BOOTX64.efi
mcopy -i /tmp/esp.img -v /tmp/grubx64.efi ::EFI/BOOT/GRUBX64.efi
mdir -i /tmp/esp.img ::EFI/BOOT
- name: Set timestamp environment variable
run: echo "TIMESTAMP=$(git show --no-patch --no-notes --pretty='%cd' --date=format:'%Y%m%d%H%M%S' ${{ github.sha }})" >> $GITHUB_ENV
- name: Publish Release
id: create_release
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2
with:
name: understack-esp-images
tag_name: understack-esp-images-${{ env.TIMESTAMP }}
make_latest: true
fail_on_unmatched_files: true
files: /tmp/esp.img
if: ${{ github.ref == 'refs/heads/main' }}