Skip to content

Commit c291a1a

Browse files
committed
Refactor GitHub workflows to simplify node setup and caching
1 parent 30a982c commit c291a1a

File tree

2 files changed

+19
-33
lines changed

2 files changed

+19
-33
lines changed

.github/workflows/algolia-index.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,16 @@ jobs:
88
name: Update Algolia index
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Internal github app token
12-
id: token
13-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
14-
with:
15-
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
16-
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
17-
1811
- uses: actions/checkout@v4
19-
with:
20-
submodules: recursive
21-
token: ${{ steps.token.outputs.token }}
2212
- uses: actions/setup-node@v4
13+
id: setup-node
2314
with:
24-
node-version: '20'
25-
cache: 'pnpm'
26-
cache-dependency-path: 'pnpm-lock.yaml'
15+
node-version-file: 'package.json'
16+
2717
- uses: pnpm/action-setup@v4
2818
with:
2919
version: 8
30-
- run: pnpm install --frozen-lockfile
20+
3121
- uses: dorny/paths-filter@v3
3222
id: filter
3323
with:
@@ -40,15 +30,15 @@ jobs:
4030
- 'develop-docs/**'
4131
- uses: oven-sh/setup-bun@v2
4232
with:
43-
bun-version: '1.1.34'
33+
bun-version: latest
4434

4535
- uses: actions/cache@v4
4636
id: cache
4737
with:
4838
path: ${{ github.workspace }}/node_modules
49-
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
39+
key: node-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
5040

51-
- run: yarn install --frozen-lockfile
41+
- run: pnpm install --frozen-lockfile
5242
if: steps.cache.outputs.cache-hit != 'true'
5343

5444
# bun seems to be the most straightforward way to run a TypeScript script

.github/workflows/lint-404s.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,15 @@ jobs:
1010
index:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Internal github app token
14-
id: token
15-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
16-
with:
17-
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
18-
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
19-
2013
- uses: actions/checkout@v4
21-
with:
22-
submodules: recursive
23-
token: ${{ steps.token.outputs.token }}
2414
- uses: actions/setup-node@v4
15+
id: setup-node
2516
with:
26-
node-version: '20'
27-
cache: 'pnpm'
28-
cache-dependency-path: 'pnpm-lock.yaml'
17+
node-version-file: 'package.json'
18+
2919
- uses: pnpm/action-setup@v4
3020
with:
3121
version: 8
32-
- run: pnpm install --frozen-lockfile
3322

3423
- uses: dorny/paths-filter@v3
3524
id: filter
@@ -45,7 +34,15 @@ jobs:
4534
with:
4635
bun-version: latest
4736

48-
# Build the app
37+
- uses: actions/cache@v4
38+
id: cache
39+
with:
40+
path: ${{ github.workspace }}/node_modules
41+
key: node-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
43+
- run: pnpm install --frozen-lockfile
44+
if: steps.cache.outputs.cache-hit != 'true'
45+
4946
- run: pnpm build
5047
if: steps.filter.outputs.docs == 'true'
5148
env:
@@ -59,7 +56,6 @@ jobs:
5956
NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0
6057
NEXT_PUBLIC_DEVELOPER_DOCS: 1
6158

62-
# Start the server in the background
6359
- name: Start Http Server
6460
run: pnpm start &
6561
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.dev-docs == 'true'

0 commit comments

Comments
 (0)