Use GitHub-to-WordPress synchronization when reviewed Markdown on the repository's default branch should publish as native WordPress Pages and Gutenberg blocks.
Choose the mode
| Workflow design | Mode | Behavior |
|---|---|---|
| GitHub is the only editing source | publish | Treat Markdown as authoritative and update managed WordPress Pages. |
| Authors edit in GitHub and WordPress | reconcile | Publish GitHub-only changes while preserving WordPress-only changes for a pull request. |
Start with the manual two-way dry run. Use the automatic workflow below only after its draft Page tree is approved.
Publish merged Markdown
This standalone workflow runs only when documentation or its workflow changes on main:
name: Publish DocsPress documentationon: push: branches: [main] paths: - "docs/**/*.md" - "docs/**/*.markdown" - "docs/**/*.json" - ".github/workflows/sync-docs.yml" workflow_dispatch:permissions: contents: readjobs: sync: runs-on: ubuntu-latest steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 - uses: Automattic/docspress@14d318924a81fb95ce4d3aaa9c3b547bf76b7768 with: mode: publish wordpress-site: example.wordpress.com wordpress-access-token: ${{ secrets.WP_ACCESS_TOKEN }} docs-dir: docs root-slug: docs root-title: Docs status: publish delete-mode: trash dry-run: false
Replace the site domain and pin revisions you have reviewed. Keep status: draft until publishing directly from main is an approved editorial policy.
What the Action changes
- Discovers Markdown and optional manifest or redirect files under
docs-dir. - Converts supported Markdown into serialized Gutenberg blocks.
- Compares the desired tree with WordPress Pages carrying the DocsPress management marker.
- Creates or updates only those managed Pages.
- Moves a managed Page to Trash when its Markdown source disappears and
delete-mode: trashis active.
Use the unified workflow for two-way editing
Do not run a separate publish workflow beside a WordPress proposal workflow for the same Page tree. Use one continuous reconcile workflow so DocsPress evaluates both versions against the same synchronization marker and stops on genuine two-sided edits.
In reconcile mode, a normal Markdown push still follows the GitHub-to-WordPress path. The difference is that a newer WordPress edit is preserved for the WordPress-to-GitHub pull request path instead of being overwritten.
Review the result
Check the Action summary for created, updated, deleted, unchanged, and conflict counts. A successful job means the planned operations completed; it does not replace editorial review of public content, navigation, blocks, or rewritten links.