-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (69 loc) · 3.36 KB
/
Copy pathdocs.yml
File metadata and controls
75 lines (69 loc) · 3.36 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Pages stub
# Publishes `.github/pages-stub/` to the `gh-pages` branch, which GitHub Pages
# serves at https://uipath.github.io/coder_eval/.
#
# This workflow used to run `mkdocs gh-deploy`, publishing a full second copy of
# docs/ here. That was a duplicate of coder-eval.com/docs: both copies declared
# themselves canonical, which splits search signals and lets the wrong host rank —
# and the mirror drifted, serving pages (BYOD, CODEX_AGENT_GUIDE) that had been
# renamed upstream. The docs are now published only at coder-eval.com/docs, synced
# from docs/ by the website's scripts/sync-docs.mjs.
#
# The mkdocs deploy is REMOVED rather than commented out: leaving it one
# uncomment away meant a future run would silently restore the duplicate. mkdocs
# itself is still used — `mkdocs.yml` remains the docs IA source of truth (CE028
# generates the index surfaces from its `nav:`, and the website derives its
# sidebar from it), and `mkdocs build` is still the way to verify anchors locally.
# What's gone is only the *publishing* of a second site.
#
# The gh-pages branch is force-replaced with the stub on each run, so the stale
# MkDocs output — including its sitemap.xml, which was still advertising the old
# URLs for indexing — is cleared rather than left alongside.
#
# Manual-only by design: the stub changes about once a year. Run it from the
# Actions tab when the stub itself changes.
on:
workflow_dispatch:
permissions:
contents: write
concurrency:
group: docs-gh-pages
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Assemble the published tree
run: |
set -euo pipefail
out="$(mktemp -d)"
cp .github/pages-stub/index.html "$out/index.html"
# Pages serves 404.html for any unknown path, so the same stub catches
# every old deep URL (/USER_GUIDE/, /tutorials/01-.../, …) without
# needing a file per route.
cp .github/pages-stub/index.html "$out/404.html"
# Without .nojekyll, Pages runs the tree through Jekyll, which strips
# files and directories whose names begin with an underscore.
touch "$out/.nojekyll"
# The old MkDocs llms.txt lived here and is referenced from the site's
# /llms.txt history; a .txt cannot meta-refresh, so point it in prose.
printf '# Coder Eval\n\nThe documentation moved to https://coder-eval.com/docs\n\nllms.txt: https://coder-eval.com/llms.txt\nFull docs in one file: https://coder-eval.com/llms-full.txt\n' \
> "$out/llms.txt"
echo "OUT_DIR=$out" >> "$GITHUB_ENV"
- name: Force-replace gh-pages with the stub
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
cd "$OUT_DIR"
git init -q -b gh-pages
git config user.name "coder-eval"
git config user.email "coder-eval@uipath.com"
git add -A
git commit -qm "Publish Pages stub redirecting to coder-eval.com/docs"
# A fresh single-commit history, force-pushed: gh-pages is a build
# artifact, so there is no history worth preserving, and this guarantees
# none of the old MkDocs output survives.
git push --force \
"https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages