Skip to content

Commit 6fffd10

Browse files
authored
fix: trigger docs deploy via workflow_call from docs.yml (#443)
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.
1 parent 71fbfd8 commit 6fffd10

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Deploy Docs to Internet Computer
22

33
on:
4-
push:
5-
branches: [docs-deployment]
4+
workflow_call:
65
workflow_dispatch:
76

87
concurrency:

.github/workflows/docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,11 @@ jobs:
212212
publish_dir: ./docs-site/dist
213213
publish_branch: docs-deployment
214214
destination_dir: ${{ env.DOCS_VERSION }}
215+
216+
# Deploy docs-deployment branch to IC asset canister.
217+
# Runs when at least one publish job succeeded (skipped on PR builds).
218+
deploy-to-ic:
219+
needs: [publish-root-files, publish-main-docs, publish-versioned-docs]
220+
if: github.event_name != 'pull_request'
221+
uses: ./.github/workflows/docs-deploy.yml
222+
secrets: inherit

docs-site/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ The site is hosted on an IC asset canister and served at `https://cli.internetco
103103
### How it works
104104

105105
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.)
106-
2. **`.github/workflows/docs-deploy.yml`** triggers on pushes to `docs-deployment` and deploys the entire branch to the IC asset canister
106+
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
107107

108108
### Triggers
109109

docs/VERSIONED_DOCS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ All built assets live on the `docs-deployment` branch:
4545

4646
**`.github/workflows/docs-deploy.yml`** — deploys `docs-deployment` to the IC:
4747

48-
- Triggers automatically whenever `docs.yml` pushes to `docs-deployment`
48+
- Called directly by `docs.yml` after publish jobs complete (avoids `GITHUB_TOKEN` cross-workflow trigger limitations)
4949
- Runs `icp deploy -e ic docs` using the `DFX_IDENTITY_DESIGN_TEAM` secret
5050
- Requires the **IC mainnet** GitHub environment
5151

0 commit comments

Comments
 (0)