forked from TDW-2023/tdw-mp1-base
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (48 loc) · 1.35 KB
/
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
60
61
62
63
64
name: Deploy
on:
pull_request:
branches:
- main
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: 'Create env file'
run: |
echo "${{ secrets.ENV_FILE }}" > config/.env
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: v18.18.1
- name: Get node version
id: node
run: |
echo "version=$(node -v)" >>$GITHUB_OUTPUT
if: success()
- name: Get node_modules cache
uses: actions/cache@v3
id: node_modules
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}-${{ steps.node.outputs.version }}
if: success()
- name: Install dependencies
run: npm ci
if: success()
- name: Run Eslint
run: npm run lint
if: success()
- name: Prettify Code
run: npm run format
if: success()
- name: Run Jest
run: npm run test
if: success()
- name: Run build
run: npm run build
if: success()
- name: Deploy
run: npx netlify-cli deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --prod