-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (48 loc) · 1.52 KB
/
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
## Continuous Integration Workflow
name: Build and Deploy
on: [push, pull_request]
# Target Branch Job
jobs:
Lint-Build-Test:
runs-on: ubuntu-latest
steps:
# Check Out Repository
- uses: actions/checkout@v1
# Install Node.js
- uses: actions/[email protected]
with:
node-version: 16.13.2
- name: Clear npm cache
run: npm cache clean --force
# Install Node Dependencies
- name: Installing NodeJS Dependencies
run: npm install
# Run Build
- name: Build
run: npm run build
# Run ESLint
- name: ESLint Check
run: npx eslint . --config .eslintrc.json --ext .js,.jsx,.ts,.tsx
# Run Prettier
- name: Prettier Check
run: npx prettier --check . --config .prettierrc.json
# # Run Jest Unit Tests
# - name: Unit Tests
# run: npx jest
# Create .env.local file
- name: Create .env.local file
run: echo "NEXT_PUBLIC_BASE_DEV_API_URL=http://localhost:4000/api" > .env.local
# Run Cypress Component Tests
- name: Component Tests
uses: cypress-io/github-action@v6
with:
component: true
# Deploy:
# needs: [Lint-Build-Test]
# runs-on: ubuntu-latest
# steps:
# # Re-Initialize Staging Server
# - if: github.ref == 'refs/heads/staging'
# name: Push Changes to Staging Server [LIVE]
# - if: github.ref == 'refs/heads/master'
# name: Push Changes to Production Server [LIVE]