Skip to content

chore(docs): add hookdoc build workflow#1201

Open
utkarshcloudinary wants to merge 1 commit into
developfrom
chore/docs-workflow
Open

chore(docs): add hookdoc build workflow#1201
utkarshcloudinary wants to merge 1 commit into
developfrom
chore/docs-workflow

Conversation

@utkarshcloudinary

Copy link
Copy Markdown
Collaborator

Summary

Adds a GitHub Actions workflow to build and publish PHP hook documentation to GitHub Pages, replacing the need for a dedicated long-lived feature/documentation branch.

Changes

  • .github/workflows/build-docs.yml — new workflow. Triggers:
    • Push to master
    • Release published
    • Manual dispatch (workflow_dispatch)
  • hookdoc-conf.json — jsdoc config
  • .hookdoc/layout.tmpl — hookdoc HTML template
  • patches/wp-hookdoc+0.2.0.patch — patches wp-hookdoc@0.2.0 to accept standard PHPDoc tag syntax (PHPStan-clean)
  • package.json:
    • Adds build:docs script (does NOT modify main build — keeps CI fast)
    • postinstall runs patch-package before composer install
    • New devDeps: jsdoc, patch-package, wp-hookdoc
  • .gitignore — ignores generated docs/ output (published to gh-pages by workflow)

Verified locally

  • npm install succeeds; patch-package applies cleanly
  • npm run build:docs generates 113 documentation files
  • wp.org deploy zip is unaffected (Gruntfile uses explicit allow-list)

Post-merge setup

One-time GitHub setup after merging to master:

  • Settings → Pages → Source: gh-pages branch, / (root)
  • No GH_PAT secret needed — uses built-in GITHUB_TOKEN

Why not update main build script?

The original feature/documentation branch made build also run build:docs, which would slow every CI run (lint, PR checks, package builds). Docs only need to build when publishing, so we isolate it to its own workflow.

Adds a GitHub Actions workflow to build and publish PHP hook
documentation to GitHub Pages, replacing the need for a dedicated
long-lived docs branch.

- Workflow triggers on push to master, release publish, and manual dispatch
- Adds jsdoc + wp-hookdoc (with patch) + patch-package
- Adds build:docs script; does not modify main build pipeline
- Ignores generated docs/ output (published to gh-pages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants