Skip to content

Commit 70bdca7

Browse files
authored
[Docs Site] Re-add CI.yml workflow (#16115)
* [Docs Site] Re-add CI.yml workflow * Fix redirects path
1 parent 14a4142 commit 70bdca7

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- production
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
compile:
14+
name: Compiles
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
24+
- name: Get npm cache directory
25+
id: npm-cache-dir
26+
shell: bash
27+
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
28+
29+
- uses: actions/cache@v4
30+
id: npm-cache
31+
with:
32+
path: ${{ steps.npm-cache-dir.outputs.dir }}
33+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
34+
restore-keys: |
35+
${{ runner.os }}-node-
36+
37+
- run: npm ci
38+
39+
- run: npx astro build
40+
env:
41+
NODE_OPTIONS: "--max-old-space-size=4192"
42+
43+
- name: Check - Validate redirects (infinite loops, sources with fragment)
44+
run: npx tsm bin/validate-redirects.ts

bin/validate-redirects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFile } from 'fs/promises';
22

33
async function main( ){
4-
const redirects = await readFile('content/_redirects', { encoding: 'utf-8' });
4+
const redirects = await readFile('public/_redirects', { encoding: 'utf-8' });
55

66
let numInfiniteRedirects = 0;
77
let numUrlsWithFragment = 0;

0 commit comments

Comments
 (0)