]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ci] Add a workflow to import images to Google Cloud gcetest
authorMichael Brown <mcb30@ipxe.org>
Tue, 10 Mar 2026 13:41:48 +0000 (13:41 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 10 Mar 2026 13:41:48 +0000 (13:41 +0000)
Add a workflow to build and import the official iPXE images for Google
Cloud.  As with the AWS import, treat this as a workflow that must be
triggered manually.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
.github/workflows/gce-import.yml [new file with mode: 0644]

diff --git a/.github/workflows/gce-import.yml b/.github/workflows/gce-import.yml
new file mode 100644 (file)
index 0000000..ed4763e
--- /dev/null
@@ -0,0 +1,94 @@
+name: Google Cloud Import
+
+on:
+  push:
+    branches:
+      - gcetest
+  workflow_dispatch:
+
+env:
+  MAKEFLAGS: "-j4 GITVERSION=${{ github.sha }}"
+
+jobs:
+
+  build:
+    name: Build / ${{ matrix.arch }}-${{ matrix.platform }}
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - arch: arm64
+            platform: efi
+          - arch: x86_64
+            platform: efi
+          - arch: x86_64
+            platform: pcbios
+    container:
+      image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
+    env:
+      bindir: bin-${{ matrix.arch }}-${{ matrix.platform }}
+    steps:
+
+      - name: Check out code
+        uses: actions/checkout@v6
+
+      - name: Build
+        working-directory: src
+        run: |
+          make CONFIG=cloud EMBED=config/cloud/gce.ipxe \
+               ${{ env.bindir }}/ipxe.usb
+
+      - name: Upload
+        uses: actions/upload-artifact@v6
+        with:
+          name: ${{ env.bindir }}
+          if-no-files-found: error
+          path: |
+            src/${{ env.bindir }}/ipxe.usb
+
+  import:
+    name: Import
+    runs-on: ubuntu-latest
+    needs:
+      - build
+    container:
+      image: ghcr.io/ipxe/ipxe-builder-cloud
+    env:
+      binaries: >-
+        bin-arm64-efi/ipxe.usb
+        bin-x86_64-efi/ipxe.usb
+        bin-x86_64-pcbios/ipxe.usb
+      family: >-
+        ${{ github.ref == 'refs/heads/gcetest' && '--family ipxetest' || '' }}
+    environment: gce-import
+    permissions:
+      id-token: write
+      contents: read
+    steps:
+
+      - name: Check out code
+        uses: actions/checkout@v6
+
+      - name: Download
+        uses: actions/download-artifact@v7
+        with:
+          path: src
+          pattern: "bin-*"
+
+      - name: Log in
+        uses: 'google-github-actions/auth@v3'
+        with:
+          project_id: ${{ vars.GCLOUD_PROJECT }}
+          workload_identity_provider: ${{ vars.GCLOUD_WORKLOAD_IDP }}
+          service_account: ${{ vars.GCLOUD_SERVICE_ACCOUNT }}
+
+      - name: Import
+        working-directory: src
+        run: |
+          ../contrib/cloud/gce-import \
+              --public \
+              --overwrite \
+              --project ${GCLOUD_PROJECT} \
+              ${{ env.family }} \
+              ${{ env.binaries }}