Merge pull request #474 from PlanExeOrg/move-experimental-code-to-exp… #232
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # When docs/ changes on main, notify PlanExe-docs to pull content and redeploy to docs.planexe.org. | |
| # PlanExe-docs listens for repository_dispatch event_type: docs-updated (see its deploy.yml). | |
| # | |
| # Required: In PlanExe repo Settings → Secrets and variables → Actions, add: | |
| # PLANEXE_DOCS_DISPATCH_TOKEN — a PAT that can trigger workflows in PlanExe-docs: | |
| # - Classic PAT: repo scope; or | |
| # - Fine-grained PAT on PlanExeOrg/PlanExe-docs with Contents: Read and write | |
| # (Contents is required for repository_dispatch; Actions alone is not enough). | |
| # If the secret is missing or has wrong permissions, this step will fail with the API error. | |
| name: Notify docs deploy | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ['docs/**'] | |
| jobs: | |
| notify-planexe-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger PlanExe-docs deploy | |
| run: | | |
| resp=$(curl -sS -w '\n%{http_code}' -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PLANEXE_DOCS_DISPATCH_TOKEN }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/PlanExeOrg/PlanExe-docs/dispatches \ | |
| -d '{"event_type":"docs-updated"}') | |
| code=$(echo "$resp" | tail -n1) | |
| body=$(echo "$resp" | sed '$d') | |
| echo "$body" | head -c 500 | |
| echo "" | |
| echo "HTTP $code" | |
| if [ "$code" -lt 200 ] || [ "$code" -ge 300 ]; then | |
| echo "Dispatch failed (expected 204). Check token permissions." | |
| exit 1 | |
| fi | |
| env: | |
| PLANEXE_DOCS_DISPATCH_TOKEN: ${{ secrets.PLANEXE_DOCS_DISPATCH_TOKEN }} |