Skip to content

Commit cef4ea9

Browse files
author
abrulic
committed
updates in yml, generate-docs, dockerfile
1 parent 8383694 commit cef4ea9

File tree

2 files changed

+84
-38
lines changed

2 files changed

+84
-38
lines changed

.github/workflows/publish-documentation.yaml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,78 @@ concurrency:
1111

1212
jobs:
1313
build-docs:
14+
name: Build Docs
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Checkout
1718
uses: actions/checkout@v4
1819
with:
20+
ref: ${{ github.head_ref }} # ← checkout the PR head branch
1921
fetch-depth: 0
22+
2023
- name: Setup pnpm
2124
uses: pnpm/action-setup@v4
25+
2226
- name: Setup Node
2327
uses: actions/setup-node@v4
2428
with:
2529
node-version-file: "package.json"
26-
cache: "pnpm"
30+
cache: pnpm
2731

2832
- name: Install deps
2933
run: pnpm install --prefer-offline --frozen-lockfile
3034

3135
- name: Generate docs
3236
working-directory: docs
37+
env:
38+
APP_ENV: production
3339
run: pnpm run generate:docs
3440

35-
- name: Upload generated docs artifact
41+
- name: Pack generated docs (tarball)
42+
run: |
43+
tar -czf docs-generated.tgz -C docs generated-docs
44+
ls -lh docs-generated.tgz
45+
46+
- name: Upload generated docs (tgz)
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: docs-generated-tgz
50+
path: docs-generated.tgz
51+
if-no-files-found: error
52+
53+
- name: Upload versions file
3654
uses: actions/upload-artifact@v4
3755
with:
38-
name: docs-generated
39-
path: |
40-
docs/generated-docs/**
41-
docs/app/utils/versions.ts
56+
name: docs-versions
57+
path: docs/app/utils/versions.ts
4258
if-no-files-found: error
4359

44-
deploy:
45-
name: 🚀 Deploy Release
60+
61+
deploy-docs-pr-preview:
4662
needs: [build-docs]
63+
name: Deploy Docs
4764
runs-on: ubuntu-latest
48-
environment:
49-
name: docs-release
5065
steps:
51-
- uses: actions/checkout@v4
52-
- name: Download generated docs
66+
- uses: actions/checkout@v4
67+
68+
- name: Download generated docs (tgz)
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: docs-generated-tgz
72+
path: .
73+
74+
- name: Unpack generated docs into docs/
75+
run: |
76+
set -euxo pipefail
77+
tar -xzf docs-generated.tgz -C docs
78+
ls -laR docs/generated-docs | sed -n '1,200p'
79+
80+
- name: Download versions file
5381
uses: actions/download-artifact@v4
5482
with:
55-
name: docs-generated
56-
path: docs
83+
name: docs-versions
84+
path: docs/app/utils
5785

58-
# check TODO remove this
59-
- name: List generated payload
60-
run: ls -laR docs/generated-docs | head -n 200
6186
- uses: forge-42/[email protected]
6287
id: deploy
6388
env:

.github/workflows/validate.yaml

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: 🚀 Validation Pipeline
22
concurrency:
33
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
44
cancel-in-progress: true
5-
65
on:
76
push:
87
branches: [main]
@@ -12,55 +11,73 @@ on:
1211
permissions:
1312
actions: write
1413
contents: read
14+
# Required to put a comment into the pull-request
1515
pull-requests: write
16-
1716
jobs:
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-
- uses: styfle/[email protected]
31-
- uses: actions/checkout@v4
32-
- uses: actions/setup-node@v4
32+
- name: 🛑 Cancel Previous Runs
33+
uses: styfle/[email protected]
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

Comments
 (0)