-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.32 KB
/
production.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
# Name of workflow
name: Production workflow
# When workflow is triggered
on:
pull_request:
branches: [main]
# push:
# branches: [main]
# Jobs to carry out
jobs:
deploy:
# Operating system to run job on
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x]
# Steps in job
steps:
# Get code from repo
- name: Checkout code
uses: actions/checkout@v1
# Install NodeJS
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Run npm install and build on our code
- name: Install Dependency and Build
working-directory: ./frontend
env:
REACT_APP_API: ${{ secrets.REACT_APP_API }}
REACT_APP_STRIPE_PUBLISHABLE_KEY: ${{ secrets.REACT_APP_STRIPE_PUBLISHABLE_KEY }}
REACT_APP_UPLOAD_TYPE: ${{ secrets.REACT_APP_UPLOAD_TYPE }}
run: |
npm ci
npm run build
# Deploy to Netlify using our production secrets
- name: Deploy to netlify
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=./frontend/build --prod