Files
MaaAssistantArknights/.github/workflows/website-workflow.yml
2026-03-14 17:34:27 +08:00

76 lines
1.8 KiB
YAML

name: Documentation Site
on:
push:
branches:
- "master-v2"
- "dev-v2"
paths:
- ".github/workflows/website-workflow.yml"
- "docs/**"
pull_request:
paths:
- ".github/workflows/website-workflow.yml"
- "docs/**"
workflow_dispatch:
inputs:
deploy-to-prod:
description: "Deploy to prod"
default: false
required: true
type: boolean
concurrency:
group: "pages"
cancel-in-progress: false
permissions:
# required for peaceiris/actions-gh-pages
contents: write
jobs:
build:
name: Build and Deploy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
show-progress: false
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: "./docs/package.json"
run_install: false
- name: Setup node.js environment
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: "./docs/pnpm-lock.yaml"
- name: Install node modules
run: pnpm install --frozen-lockfile
working-directory: "./docs"
- name: Build
run: pnpm run build
working-directory: "./docs"
- name: Upload artifact to GitHub
uses: actions/upload-artifact@v7
with:
name: dist
path: "./docs/.vuepress/dist"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.repository_owner == 'MaaAssistantArknights' && (inputs.deploy-to-prod == true || github.ref == 'refs/heads/master-v2')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "./docs/.vuepress/dist"
publish_branch: gh-pages