From 550b5ab2dc319ef0113f454d1d87e795e60deff3 Mon Sep 17 00:00:00 2001 From: mehfuz Date: Fri, 6 Nov 2026 10:21:17 -0800 Subject: [PATCH] Rebuild smartloop.ai when a release is published The site bakes the latest published release into its build and listens for a release-published repository_dispatch, but nothing sent one, so the version on smartloop.ai lagged until the daily rebuild. Dispatch it right after the publish step, using a WEBSITE_DISPATCH_TOKEN PAT (GITHUB_TOKEN can't reach another repo). A missing token or failed dispatch only warns. --- .github/workflows/build-and-deploy.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index fec9cef..cfc1e48 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -693,6 +693,27 @@ jobs: run: | python scripts/ci_push_release.py --file release.json + # smartloop.ai bakes the latest published release into its build + # (website/docusaurus.config.ts), so ask its Pages workflow to rebuild now + # instead of waiting for the daily run. GITHUB_TOKEN can't dispatch to + # another repo; WEBSITE_DISPATCH_TOKEN is a fine-grained PAT on + # smartloop-ai/website with Contents: read & write. The release is already + # live at this point, so a failed dispatch only warns — the site's daily + # cron still picks it up. + - name: Rebuild smartloop.ai with the new version + env: + GH_TOKEN: ${{ secrets.WEBSITE_DISPATCH_TOKEN }} + run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::WEBSITE_DISPATCH_TOKEN not set; smartloop.ai updates on its next daily build." + exit 0 + fi + VERSION=$(jq -r .version release.json) + gh api repos/smartloop-ai/website/dispatches \ + -f event_type=release-published \ + -f "client_payload[version]=$VERSION" \ + || echo "::warning::Could not trigger the smartloop.ai rebuild; it updates on its next daily build." + notify-result: if: always() needs: [notify-start, build-macos, build-linux, build-windows, upload-to-gcp, create-draft-release]