CI/CD Pipelines
Use CI/CD workflows to automatically build and deploy your docmd site every time you push changes. Below are ready-to-use configurations for popular cloud platforms.
Cloud Platforms
GitHub Pages
Vercel
Netlify
Cloudflare Pages
Firebase
The recommended method is using GitHub Actions to automate your deployments on every push.
Create .github/workflows/deploy.yml:
name: Deploy docmd
on:
push:
branches: ["main"]
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '22' }
- run: npx @docmd/core build
- uses: actions/upload-pages-artifact@v3
with: { path: ./site }
- uses: actions/deploy-pages@v4
- Connect your repository to Vercel.
- In the project Build Settings:
- Framework Preset:
Other - Build Command:
npx @docmd/core build - Output Directory:
site
- Framework Preset:
- Deploy. Vercel automatically detects the static output and serves it globally.
- Import your project from GitHub/GitLab/Bitbucket.
- Configure your build settings:
- Build command:
npx @docmd/core build - Publish directory:
site
- Build command:
- Click Deploy site. Netlify’s CDN will handle the routing and asset delivery.
- Create a new project in the Cloudflare Dashboard under Pages.
- Connect your git provider and select your repository.
- Configure the build settings:
- Framework preset:
None - Build command:
npx @docmd/core build - Build output directory:
site
- Framework preset:
- Save and Deploy.
- Install the Firebase CLI:
npm install -g firebase-tools. - Build your site:
npx @docmd/core build. - Run
firebase init hostingand select your project. - Set the public directory to
site. - Configure as a single-page app:
Yes(this handles the 404 behaviour). - Deploy using
firebase deploy.
Why npx @docmd/core?
In CI/CD environments where docmd is not globally installed, use npx @docmd/core to run the scoped package directly. If your project has @docmd/core listed as a devDependency, simply using docmd build after npm install will also work.
Manual / Static Server
For traditional web servers (NGINX, Apache, IIS):
- Generate the site:
npx @docmd/core build. - Upload the contents of the
site/folder to your server via SFTP, SCP, or your preferred deployment tool. - Ensure your server is configured to serve
index.htmlfor directories (the default for most).
For self-hosted environments like Docker, NGINX, or Caddy, see the dedicated Deployment guides.