name: MaaWebsite Workflow on: push: branches: - "master" - "dev" 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 jobs: build: runs-on: ubuntu-latest timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@v5 with: show-progress: false - name: Setup Pages if: github.repository_owner == 'MaaAssistantArknights' uses: actions/configure-pages@v5 - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10 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 dependencies run: pnpm install --frozen-lockfile working-directory: "./docs" - name: Build documentation run: pnpm run build working-directory: "./docs" - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: 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') with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: "./docs/.vuepress/dist" publish_branch: gh-pages