-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.05 KB
/
cd.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
name: FRONTEND Continuous Deployment
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "18.x"
- name: Install dependencies
run: |
cd frontend
npm install
- name: Build
run: |
cd frontend
npm run build
- name: Install Netlify CLI
run: npm install -g netlify-cli
- name: Deploy to Netlify
if: github.ref == 'refs/heads/master' # Deploy only on master branch
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID}}
run: |
cd frontend
netlify deploy --prod --dir=build --site=${NETLIFY_SITE_ID} --message="Deployed from GitHub Actions"