Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 0060eed

Browse files
committed
Add GitHub Actions
1 parent 9df61fb commit 0060eed

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

.github/actions/setup/action.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Setup Action'
2+
description: 'Checks out the repo, sets up node, and installs dependencies'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Checkout repository
7+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
8+
9+
- name: Set up Node.js
10+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
11+
with:
12+
node-version: '22'
13+
14+
- name: Cache dependencies
15+
id: cache
16+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
17+
with:
18+
path: ./node_modules
19+
key: modules-${{ hashFiles('package-lock.json') }}
20+
21+
- name: Install dependencies
22+
if: steps.cache.outputs.cache-hit != 'true'
23+
run: npm ci
24+
shell: bash
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Static checks
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint:
8+
name: Lint and format checks
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
13+
14+
- name: Setup
15+
uses: ./.github/actions/setup
16+
17+
- name: Run ESLint
18+
run: npm run eslint
19+
20+
- name: Run markdownlint
21+
uses: DavidAnson/markdownlint-cli2-action@a23dae216ce3fee4db69da41fed90d2a4af801cf # v19
22+
with:
23+
globs: |
24+
**/*.md
25+
!node_modules
26+
27+
- name: Run Prettier
28+
run: npm run prettier
29+
30+
build:
31+
name: Build site
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout Repository
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
36+
37+
- name: Setup
38+
uses: ./.github/actions/setup
39+
40+
- name: Build site
41+
run: npm run build

.github/workflows/on-pr.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: On PR
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
static-checks:
11+
name: Static checks
12+
uses: ./.github/workflows/_static-checks.yaml
13+
secrets: inherit

0 commit comments

Comments
 (0)