-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.48 KB
/
main.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
name: Deploy to Production
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- "**.md"
- "**.yml"
jobs:
deploy:
runs-on: ubuntu-latest
env:
API_KEY: ${{ secrets.API_KEY }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install project dependencies
run: |
npm install --legacy-peer-deps
echo Dependencies installed successfully
- name: Generate API keys
run: |
echo REACT_APP_API_KEY=$API_KEY > .env
echo API keys generated successfully
- name: Build project for production
run: |
npm run winBuild
echo Project built successfully
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: build
- name: Install Netlify CLI and deploy to prod
run: |
npm install netlify-cli --save-dev --legacy-peer-deps --force
netlify deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir=build --prod
echo App is live