Skip to content

Commit

Permalink
feat: add Node.js CI
Browse files Browse the repository at this point in the history
  • Loading branch information
falsepopsky authored Jul 12, 2024
1 parent 98485f2 commit 2809396
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ jobs:
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.LABELER_TOKEN }}
configuration-path: .github/labeler.yaml
53 changes: 53 additions & 0 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Node.js CI

on:
pull_request:
types: [opened, labeled]
branches: main

defaults:
run:
working-directory: ./frontend

jobs:
lint:
if: contains(github.event.pull_request.labels.*.name, 'frontend')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: "./frontend/package.json"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "./frontend/.nvmrc"
cache: pnpm
cache-dependency-path: "./frontend/pnpm-lock.yaml"
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm lint
build:
if: contains(github.event.pull_request.labels.*.name, 'frontend')
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: "./frontend/package.json"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "./frontend/.nvmrc"
cache: pnpm
cache-dependency-path: "./frontend/pnpm-lock.yaml"
- name: Install dependencies
run: pnpm install
- name: Run build
run: pnpm build

0 comments on commit 2809396

Please sign in to comment.