-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.38 KB
/
server-deploy.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
51
52
53
54
55
56
57
58
59
name: server
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 18.12.0
cache: "npm"
cache-dependency-path: ./package-lock.json
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: server/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}
- name : Setting .ENV
run : |
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" > .env
- name: Install
run: npm install
- name: Install Dependencies
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: npm ci
- name: Run Test(only Changed)
run: npm run test:only-changed
- name: Run Lint(only Changed)
run : npm run format:diff
- name: Run Build
run: npm run build