From ad3130baa39e6e3be753ae6ce2375ef4bd7467a0 Mon Sep 17 00:00:00 2001 From: "P." Date: Wed, 18 Nov 2026 10:02:27 -0600 Subject: [PATCH] ci(publish): notify EKS when a testing image is published After the Grype gate that already guards the customers-cdk promote, send a testing-image-published repository_dispatch to simplerisk/kubernetes, where the EKS dev tier merges its release PR and rolls. The token comes from a GitHub App scoped to that one repo with contents:write; the job is a no-op until the testing environment has EKS_DISPATCH_CLIENT_ID. Co-authored-by: Claude Opus 5.5 --- .github/workflows/publish-testing.yml | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/publish-testing.yml b/.github/workflows/publish-testing.yml index 38093a5..cfc2335 100644 --- a/.github/workflows/publish-testing.yml +++ b/.github/workflows/publish-testing.yml @@ -47,6 +47,10 @@ name: Publish testing images + promote # in the customers account via OIDC; the image-updater Lambda there rolls every # tier=testing service (new image + fresh extras together). The full-stack image # is not part of the managed fleet, so it has no SSM tier. +# +# Notify EKS: after the same scan gate, sends `testing-image-published` to +# simplerisk/kubernetes, where the EKS dev tier merges its release PR and rolls. +# Skipped until the `testing` environment has EKS_DISPATCH_CLIENT_ID. on: push: @@ -335,6 +339,52 @@ jobs: --region "$AWS_REGION" echo "promoted $SSM_PARAM = ${VERSION}-php85" >> "$GITHUB_STEP_SUMMARY" + notify-eks: + name: Notify EKS — release published + needs: [resolve, scan-minimal] + # NOTE: same gate as promote: never for a dry run, never past a failed scan. + if: ${{ needs.resolve.outputs.dry_run != 'true' }} + environment: testing + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: {} + steps: + - name: Check the dispatch app is configured + id: wired + env: + CLIENT_ID: ${{ vars.EKS_DISPATCH_CLIENT_ID }} + run: | + if [ -n "$CLIENT_ID" ]; then + echo "wired=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::EKS_DISPATCH_CLIENT_ID is not set; EKS is not notified" + echo "wired=false" >> "$GITHUB_OUTPUT" + fi + + - name: Mint a token scoped to simplerisk/kubernetes + if: steps.wired.outputs.wired == 'true' + id: token + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + client-id: ${{ vars.EKS_DISPATCH_CLIENT_ID }} + private-key: ${{ secrets.EKS_DISPATCH_PRIVATE_KEY }} + owner: simplerisk + repositories: kubernetes + permission-contents: write + + - name: Send testing-image-published + if: steps.wired.outputs.wired == 'true' + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + VERSION: ${{ needs.resolve.outputs.version }} + run: | + set -euo pipefail + gh api repos/simplerisk/kubernetes/dispatches \ + -f event_type=testing-image-published \ + -f "client_payload[version]=${VERSION}" \ + -f "client_payload[tag]=${VERSION}-php85" + echo "notified simplerisk/kubernetes: ${VERSION}-php85 is published" >> "$GITHUB_STEP_SUMMARY" + # The full-stack image is built here for the same build-once reason as the # minimal one: GA promotes this digest rather than rebuilding from the prod # bundle. It is amd64-only, matching what the release build published before.