mirror of
https://github.com/sebastianflint/pve-panel.git
synced 2026-12-04 06:13:18 +00:00
73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
# Builds the documentation website (website/, Docusaurus) and publishes it on
|
|
# GitHub Pages: https://sebastianflint.github.io/pve-panel/
|
|
# One-time setup: repository Settings → Pages → Source: "GitHub Actions".
|
|
|
|
name: Documentation
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "website/**"
|
|
- "docs/screenshots/**"
|
|
- "example.env"
|
|
- ".github/workflows/docs.yml"
|
|
pull_request:
|
|
paths:
|
|
- "website/**"
|
|
- "docs/screenshots/**"
|
|
- "example.env"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
defaults:
|
|
run:
|
|
working-directory: website
|
|
steps:
|
|
- name: Check out (full history, for "last updated" dates)
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
cache-dependency-path: website/package-lock.json
|
|
|
|
- name: Install
|
|
run: npm ci
|
|
|
|
- name: Build (fails on broken links)
|
|
run: npm run build
|
|
|
|
- name: Upload site
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: website/build
|
|
|
|
deploy:
|
|
if: github.event_name != 'pull_request'
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Publish to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|