Skip to content

Commit badedd1

Browse files
authored
feat: add Node.js CI
1 parent 98485f2 commit badedd1

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/labeler.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ jobs:
1111
steps:
1212
- uses: actions/labeler@v5
1313
with:
14+
repo-token: ${{ secrets.LABELER_TOKEN }}
1415
configuration-path: .github/labeler.yaml

.github/workflows/node.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Node.js CI
2+
on:
3+
pull_request:
4+
types: [opened, labeled]
5+
branches: main
6+
defaults:
7+
run:
8+
working-directory: ./frontend
9+
10+
11+
jobs:
12+
lint:
13+
if: contains(github.event.pull_request.labels.*.name, 'frontend')
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/[email protected]
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
package_json_file: "./frontend/package.json"
22+
- name: Setup Node
23+
uses: actions/[email protected]
24+
with:
25+
node-version-file: "./frontend/.nvmrc"
26+
cache: pnpm
27+
cache-dependency-path: "./frontend/pnpm-lock.yaml"
28+
- name: Install dependencies
29+
run: pnpm install
30+
- name: Run lint
31+
run: pnpm lint
32+
build:
33+
if: contains(github.event.pull_request.labels.*.name, 'frontend')
34+
runs-on: ubuntu-latest
35+
needs: [lint]
36+
steps:
37+
- name: Checkout repo
38+
uses: actions/[email protected]
39+
- name: Setup pnpm
40+
uses: pnpm/action-setup@v4
41+
with:
42+
package_json_file: "./frontend/package.json"
43+
- name: Setup Node
44+
uses: actions/[email protected]
45+
with:
46+
node-version-file: "./frontend/.nvmrc"
47+
cache: pnpm
48+
cache-dependency-path: "./frontend/pnpm-lock.yaml"
49+
- name: Install dependencies
50+
run: pnpm install
51+
- name: Run build
52+
run: pnpm build

0 commit comments

Comments
 (0)