Skip to content

Instantly share code, notes, and snippets.

@dig1t
Last active February 22, 2025 22:50
Show Gist options
  • Save dig1t/de30439c0f087e82369cca1a48296046 to your computer and use it in GitHub Desktop.
Save dig1t/de30439c0f087e82369cca1a48296046 to your computer and use it in GitHub Desktop.
GitHub Action to automatically deploy moonwave docs to GitHub Pages
# .github/workflows/docs.yml
name: Deploy documentation to GitHub Pages
on:
push:
branches:
- main
paths:
- 'src/**'
- 'docs/**'
- 'moonwave.toml'
permissions:
contents: write
pages: write
id-token: write
# Prevent concurrent runs
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Build documentation
run: npm run build:docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
{
"name": "repository",
"version": "1.0.0",
"dependencies": {
"moonwave": "^1.1.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment