@@ -2,7 +2,6 @@ name: 🚀 Validation Pipeline
22concurrency :
33 group : ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
44 cancel-in-progress : true
5-
65on :
76 push :
87 branches : [main]
1211permissions :
1312 actions : write
1413 contents : read
14+ # Required to put a comment into the pull-request
1515 pull-requests : write
16-
1716jobs :
1817 lint :
1918 name : ⬣ Biome lint
2019 runs-on : ubuntu-latest
2120 steps :
22- - uses : actions/checkout@v4
23- - uses : biomejs/setup-biome@v2
24- - run : biome ci .
21+ - name : ⬇️ Checkout repo
22+ uses : actions/checkout@v4
23+ - name : Setup Biome
24+ uses : biomejs/setup-biome@v2
25+ - name : Run Biome
26+ run : biome ci .
2527
2628 validate :
2729 name : 🔎 Validate
2830 runs-on : ubuntu-latest
2931 steps :
30- 31- - uses : actions/checkout@v4
32- - uses : actions/setup-node@v4
32+ - name : 🛑 Cancel Previous Runs
33+ 34+ - name : ⬇️ Checkout repo
35+ uses : actions/checkout@v4
36+ - name : ⎔ Setup node
37+ uses : actions/setup-node@v4
3338 with :
34- node-version : 20
35- - uses : pnpm/action-setup@v4
36- - run : pnpm install
37- - run : pnpm run test
39+ node-version-file : " package.json"
40+ - name : Install pnpm
41+ uses : pnpm/action-setup@v4
42+ - name : Install dependencies
43+ run : pnpm install
44+ - name : 🔎 Validate
45+ run : pnpm run test
46+
3847
3948 build-docs :
4049 if : ${{ github.event_name == 'pull_request' }}
4150 name : Build Docs
4251 runs-on : ubuntu-latest
4352 steps :
44- - uses : actions/checkout@v4
53+ - name : Checkout
54+ uses : actions/checkout@v4
4555 with :
56+ ref : ${{ github.head_ref }} # ← checkout the PR head branch
4657 fetch-depth : 0
47- - uses : pnpm/action-setup@v4
48- - uses : actions/setup-node@v4
58+
59+ - name : Setup pnpm
60+ uses : pnpm/action-setup@v4
61+
62+ - name : Setup Node
63+ uses : actions/setup-node@v4
4964 with :
5065 node-version-file : " package.json"
5166 cache : pnpm
5267
53- - run : pnpm install --prefer-offline --frozen-lockfile
68+ - name : Install deps
69+ run : pnpm install --prefer-offline --frozen-lockfile
5470
5571 - name : Generate docs
5672 working-directory : docs
5773 env :
5874 APP_ENV : production
59- DOCS_BRANCH : ${{ github.event.repository.default_branch }}
6075 run : pnpm run generate:docs
6176
6277 - name : Pack generated docs (tarball)
63- run : tar -czf docs-generated.tgz -C docs generated-docs
78+ run : |
79+ tar -czf docs-generated.tgz -C docs generated-docs
80+ ls -lh docs-generated.tgz
6481
6582 - name : Upload generated docs (tgz)
6683 uses : actions/upload-artifact@v4
@@ -76,13 +93,14 @@ jobs:
7693 path : docs/app/utils/versions.ts
7794 if-no-files-found : error
7895
96+
7997 deploy-docs-pr-preview :
8098 if : ${{ github.event_name == 'pull_request' }}
81- name : 🚀 Deploy Docs
8299 needs : [lint, validate, build-docs]
100+ name : Deploy Docs PR Preview
83101 runs-on : ubuntu-latest
84102 steps :
85- - uses : actions/checkout@v4
103+ - uses : actions/checkout@v4
86104
87105 - name : Download generated docs (tgz)
88106 uses : actions/download-artifact@v4
@@ -91,7 +109,10 @@ jobs:
91109 path : .
92110
93111 - name : Unpack generated docs into docs/
94- run : tar -xzf docs-generated.tgz -C docs
112+ run : |
113+ set -euxo pipefail
114+ tar -xzf docs-generated.tgz -C docs
115+ ls -laR docs/generated-docs | sed -n '1,200p'
95116
96117 - name : Download versions file
97118 uses : actions/download-artifact@v4
0 commit comments