Skip to content

Commit

Permalink
feat: adds github workflow to create an ironic esp image
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaskuechler committed Nov 7, 2024
1 parent 21624f8 commit ddd33ea
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-ironic-esp-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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' }}

0 comments on commit ddd33ea

Please sign in to comment.