-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds github workflow to create an ironic esp image
- Loading branch information
1 parent
21624f8
commit ddd33ea
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
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' }} |