From 48a9ecbef8fcbdbcde92bb21c7e89ab6a687d24a Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Wed, 18 Mar 2026 09:12:41 +0100 Subject: [PATCH] fix: trigger docs deploy via workflow_call from docs.yml workflow_run does not fire for tag-triggered workflows, and GITHUB_TOKEN pushes do not trigger other workflows. Use workflow_call instead: docs.yml explicitly calls docs-deploy.yml after publish jobs complete. The deploy job only runs when at least one publish job succeeded, so PR builds (where all publish jobs are skipped) do not trigger a deploy. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/docs-deploy.yml | 3 +-- .github/workflows/docs.yml | 8 ++++++++ docs-site/README.md | 2 +- docs/VERSIONED_DOCS.md | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index ccfc2064..c7d35011 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -1,8 +1,7 @@ name: Deploy Docs to Internet Computer on: - push: - branches: [docs-deployment] + workflow_call: workflow_dispatch: concurrency: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7cb8991a..f11faa79 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -212,3 +212,11 @@ jobs: publish_dir: ./docs-site/dist publish_branch: docs-deployment destination_dir: ${{ env.DOCS_VERSION }} + + # Deploy docs-deployment branch to IC asset canister. + # Runs when at least one publish job succeeded (skipped on PR builds). + deploy-to-ic: + needs: [publish-root-files, publish-main-docs, publish-versioned-docs] + if: github.event_name != 'pull_request' + uses: ./.github/workflows/docs-deploy.yml + secrets: inherit diff --git a/docs-site/README.md b/docs-site/README.md index 6483d3b2..32ff0cc2 100644 --- a/docs-site/README.md +++ b/docs-site/README.md @@ -103,7 +103,7 @@ The site is hosted on an IC asset canister and served at `https://cli.internetco ### How it works 1. **`.github/workflows/docs.yml`** builds documentation and pushes built files to the `docs-deployment` branch (one directory per version: `0.1/`, `0.2/`, `main/`, etc.) -2. **`.github/workflows/docs-deploy.yml`** triggers on pushes to `docs-deployment` and deploys the entire branch to the IC asset canister +2. **`.github/workflows/docs-deploy.yml`** is called by `docs.yml` after publish jobs complete and deploys the entire `docs-deployment` branch to the IC asset canister ### Triggers diff --git a/docs/VERSIONED_DOCS.md b/docs/VERSIONED_DOCS.md index b5cf2e11..e3ef9253 100644 --- a/docs/VERSIONED_DOCS.md +++ b/docs/VERSIONED_DOCS.md @@ -45,7 +45,7 @@ All built assets live on the `docs-deployment` branch: **`.github/workflows/docs-deploy.yml`** — deploys `docs-deployment` to the IC: -- Triggers automatically whenever `docs.yml` pushes to `docs-deployment` +- Called directly by `docs.yml` after publish jobs complete (avoids `GITHUB_TOKEN` cross-workflow trigger limitations) - Runs `icp deploy -e ic docs` using the `DFX_IDENTITY_DESIGN_TEAM` secret - Requires the **IC mainnet** GitHub environment