-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.29 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: 🧺 Lint
run-name: "${{ github.ref_name == 'main' && 'PRD' || 'STG' }} - 🧼 Linting ${{ github.event_name == 'pull_request' && format('PR #{0}: {1}', github.event.pull_request.number, github.event.pull_request.title) || format('latest {0}', github.ref_name) }}"
on:
workflow_dispatch:
pull_request:
paths:
- "front/**"
branches: [main, develop]
push:
paths:
- "front/**"
branches: [main, develop]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
lint:
name: 💅 Prettier
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name == 'main' && 'prd' || 'stg' }}
steps:
- name: 𐂷 Checkout
uses: actions/checkout@v3
with:
repository: dgrebb/dgrebb.com
ref: ${{ github.ref }}
token: ${{ github.token }}
sparse-checkout: |
front
- name: ⬢ Setup Node & Cache
uses: actions/setup-node@v3
with:
node-version: "18.17.1"
cache: "npm"
cache-dependency-path: |
front/package.json
front/package-lock.json
front/node_modules
- name: ↧ Install & Patch
run: cd front && npm ci
- name: 👓 Check
run: |
cd front && npm run lint