4545 run : pnpm run test
4646
4747 build-docs :
48+ name : ⬆️ Build Docs
4849 runs-on : ubuntu-latest
50+ # FIXME:MONOREPO If docs are in a subdirectory, uncomment the next line
51+ # defaults:
52+ # run:
53+ # working-directory: docs
4954 steps :
5055 - uses : actions/checkout@v4
5156 with :
@@ -61,32 +66,12 @@ jobs:
6166 - name : Install deps
6267 run : pnpm install --prefer-offline --frozen-lockfile
6368
64- # Decide where the docs app lives: ./docs or .
65- - name : Resolve DOCS_DIR
66- id : paths
67- shell : bash
68- run : |
69- if [ -d docs ] && [ -f docs/package.json ]; then
70- DOCS_DIR="docs"
71- else
72- DOCS_DIR="."
73- fi
74-
75- # expose for later steps
76- echo "DOCS_DIR=$DOCS_DIR" >> "$GITHUB_OUTPUT"
77-
78- # ok to print within this step using the shell variable
79- echo "Using DOCS_DIR=$DOCS_DIR"
80-
8169 - name : Generate docs
82- env :
83- APP_ENV : production
84- run : pnpm -C "${{ steps.paths.outputs.DOCS_DIR }}" run generate:docs
70+ run : pnpm run generate:docs
8571
8672 - name : Pack generated docs (tarball)
8773 run : |
88- OUT_BASE="${{ steps.paths.outputs.DOCS_DIR }}"
89- tar -czf docs-generated.tgz -C "$OUT_BASE" generated-docs
74+ tar -czf docs-generated.tgz generated-docs
9075 ls -lh docs-generated.tgz
9176
9277 - name : Upload generated docs (tgz)
@@ -100,14 +85,18 @@ jobs:
10085 uses : actions/upload-artifact@v4
10186 with :
10287 name : docs-versions
103- path : ${{ steps.paths.outputs.DOCS_DIR }}/ app/utils/versions.ts
88+ path : app/utils/versions.ts
10489 if-no-files-found : error
10590
10691 deploy-docs-pr-preview :
92+ name : 🚀 Deploy Docs
10793 if : ${{ github.event_name == 'pull_request' }}
10894 needs : [lint, validate, build-docs]
109- name : Deploy Docs PR Preview
11095 runs-on : ubuntu-latest
96+ # FIXME:MONOREPO If docs are in a subdirectory, uncomment the next line
97+ # defaults:
98+ # run:
99+ # working-directory: docs
111100 steps :
112101 - uses : actions/checkout@v4
113102
@@ -117,16 +106,16 @@ jobs:
117106 name : docs-generated-tgz
118107 path : .
119108
120- - name : Unpack generated docs into docs/
109+ - name : Unpack generated docs
121110 run : |
122- set -euxo pipefail
123- tar -xzf docs- generated.tgz -C docs
124- ls -laR docs/generated-docs | sed -n '1,200p'
111+ tar -xzf docs-generated.tgz
112+ ls -laR generated-docs | sed -n '1,200p'
113+
125114 - name : Download versions file
126115 uses : actions/download-artifact@v4
127116 with :
128117 name : docs-versions
129- path : docs/ app/utils
118+ path : app/utils
130119
131120 - uses : forge-42/fly-deploy@v1.0.0-rc.2
132121 id : deploy
@@ -135,7 +124,8 @@ jobs:
135124 FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
136125 FLY_REGION : ${{ vars.FLY_REGION }}
137126 with :
138- workspace_name : docs
127+ # FIXME:MONOREPO If docs are in a subdirectory, change this to: docs
128+ workspace_name : .
139129 app_name : react-router-devtools-docs-pr-${{ github.event.number }}
140130 use_isolated_workspace : true
141131 env_vars : |
0 commit comments