-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.42 KB
/
quic_repo_frontend_build_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
name: Front End - Build and Deploy to Netlify
on:
push:
branches:
- 'main'
paths:
- 'Front-End/**'
defaults:
run:
working-directory: ./Front-End
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Repository Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: './Front-End/package-lock.json'
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
enableCrossOsArchive: false
fail-on-cache-miss: false
lookup-only: false
- name: Create env file
run: |
touch .env
echo "${{ secrets.FRONT_END_ENV }}" > .env
- name: Install Netlify
run: npm install netlify-cli --location=global
- name: Install Dependencies
run: npm install
- name: Build project
run: npm run build
- name: Deploy to Netlify
id: netlify_deploy
run: |
cp _redirects dist
netlify deploy \
--dir dist \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_API_TOKEN }} \
--prod