-
Notifications
You must be signed in to change notification settings - Fork 6
executable file
·78 lines (68 loc) · 2.14 KB
/
ci.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
env:
NODE_OPTIONS: --max_old_space_size=4096
NODE_VERSION: 18.16.0
NPM_VERSION: 9.5.1
concurrency:
# Prevent parallel builds of the same branch
group: cicd-${{ github.ref }}
cancel-in-progress: false
jobs:
requirements:
name: Continuous Integration
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Adjust npm version
run: npm install -g npm@${{ env.NPM_VERSION }}
- uses: actions/cache@v3
name: Setup npm cache
with:
path: node_modules
key: ${{ runner.os }}-npm-store-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-store-
- name: Install dependencies
run: make deps
- name: Lint
run: make lint
- name: Format check
run: make format-check
- name: Build
env:
CRISP_WEBSITE_ID: ${{ secrets.CRISP_WEBSITE_ID }}
run: make build
- name: Install PDF tool
# [WORKAROUND] It should have worked by using it inside a Docker container but something is broken
# Ref: https://github.com/signcl/docusaurus-prince-pdf/issues/34
run: |
curl https://www.princexml.com/download/prince-14.2-linux-generic-x86_64.tar.gz -O
tar zxf prince-14.2-linux-generic-x86_64.tar.gz
cd prince-14.2-linux-generic-x86_64
yes "" | sudo ./install.sh
- name: Generate PDF
run: make generate-pdf-in-ci
- name: Deploy to Netlify
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: netlify/actions/cli@master
with:
args: deploy --dir=dist --prod
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}