Skip to content

Commit 36bb568

Browse files
authored
Merge pull request #12 from falsepopsky/node-ci
feat: add Node.js CI
2 parents 98485f2 + 2809396 commit 36bb568

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-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

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

0 commit comments

Comments
 (0)