forked from protoLabsAI/protoAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 2.3 KB
/
Copy pathdocs.yml
File metadata and controls
58 lines (53 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Deploy docs to GitHub Pages
on:
push:
branches: [main]
paths: ['docs/**', 'package.json', 'package-lock.json', '.github/workflows/docs.yml']
# PR-level gate (#976): vitepress fails the build on parse errors AND dead links,
# so running docs:build here catches doc breakage at review time instead of letting
# it merge green and only go red on the main-only deploy. Build-only — no deploy.
# Unfiltered on purpose: `build` is a REQUIRED check in the main ruleset, and a
# path-filtered required check never reports on non-matching PRs, blocking them
# forever. Running everywhere (~30s) is the price of making red docs unmergeable
# (a dead link once automerged and froze the Pages deploy on every main push).
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
# Ref-scoped so a PR build never serializes behind (or cancels) the main pages
# deploy — each ref gets its own group; main keeps a stable group of its own.
group: pages-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest # workspace-config: allow-hosted-runner public repo — GH-hosted is free
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
- run: npm install
- run: npm run docs:build
- uses: actions/upload-pages-artifact@v5
# Only needed to feed the deploy job — skip on PRs (build-only gate).
if: github.event_name != 'pull_request'
with:
path: docs/.vitepress/dist
deploy:
needs: build
# Never deploy from a PR — PRs only validate the build above. Fork-friendly
# (#1534): deploys to protoLabs' GitHub Pages, so only the canonical repo runs
# it — a fork without Pages configured would otherwise get a deploy error. The
# `build` job above is unguarded on purpose: forks want it (catches VitePress breakage).
if: github.event_name != 'pull_request' && github.repository == 'protoLabsAI/protoAgent'
runs-on: ubuntu-latest # workspace-config: allow-hosted-runner public repo — GH-hosted is free
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5