-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (80 loc) · 2.72 KB
/
code_review.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Code Review
on:
pull_request:
push:
branches:
- main
defaults:
run:
shell: bash
jobs:
compile:
name: Compile project
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup Node.JS
uses: ./.github/actions/setup-node
- name: Check lock file
run: npx -y [email protected]
- name: Install dependencies
run: npm ci --audit=false --fund=false
- name: Compile
run: npm run compile
- name: Store in cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
code_checks:
name: Code checks
runs-on: ubuntu-latest
needs: compile
steps:
- name: Restore cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: Check lint rules
run: npm run lint
- name: Run tests
run: npm run test
build_website:
name: Build Website
runs-on: ubuntu-latest
strategy:
matrix:
# We want to make sure the env variables are set correctly
environment: [ 'dev', 'prod' ]
fail-fast: false # Do not cancel any other jobs in the matrix, if a single job fails
environment: ${{ matrix.environment }}
needs: compile
steps:
- name: Restore cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: Build NextJS Website
uses: ./.github/actions/build-nextjs-website
with:
path_to_gitbook_docs: ${{ github.workspace }}/apps/nextjs-website/docs
cookie_domain_script: ${{ secrets.COOKIE_DOMAIN_SCRIPT }}
allow_crawler: ${{ vars.ALLOW_CRAWLER }}
cognito_user_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID }}
cognito_identity_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID }}
cognito_app_client_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_WEB_CLIENT_ID }}
cognito_aws_region: 'eu-south-1'
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}
- name: Check NextJS bundle size
uses: ./.github/actions/check-nextjs-bundle-size
with:
path_to_nextjs_folder: ./apps/nextjs-website
upload_path: apps/nextjs-website/.next/analyze/__bundle_analysis.json