Build and deploy your docmd documentation site to GitHub Pages. Zero config, with automatic project configuration detection.
Add to any workflow:
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- uses: docmd-io/deploy@v1.1
id: build
- uses: actions/upload-pages-artifact@v5
with:
path: ${{ steps.build.outputs.site-dir }}
- uses: actions/deploy-pages@v5
id: deployOr use the reusable workflow for even less boilerplate:
on:
push:
branches: [main]
jobs:
docs:
uses: docmd-io/deploy/.github/workflows/deploy.yml@v1.1- Detects
docmd.config.jsonanywhere in the repo - Falls back to
npx @docmd/core initif no config is found - Installs dependencies: runs
npm ciif apackage.jsonis present, otherwise installs@docmd/coredirectly - Builds the site and outputs the path via
site-dir
| Input | Default | Description |
|---|---|---|
node |
20 |
Node.js version |
| Output | Description |
|---|---|
site-dir |
Path to the built site directory |
GitHub Pages must be set to deploy from GitHub Actions (not a branch).
Go to Settings → Pages → Source → GitHub Actions.
This only needs to be configured once per repository.