-
Notifications
You must be signed in to change notification settings - Fork 247
105 lines (93 loc) · 2.99 KB
/
deploy-develop.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Deploy Develop to Netlify
on:
push:
branches:
- develop
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build-deploy:
runs-on: docs-16c-64gb-600gb
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch whole repo so git-restore-mtime can work
lfs: true
- name: Adjust file watchers limit
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: "package-lock.json"
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: |
npm run presetup
npm ci --ignore-scripts
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run NPM install scripts
run: |
npm rebuild
- name: Checking Gatsby cache
id: gatsby-cache-build
uses: actions/cache@v3
with:
path: |
public/*
!public/pdfs
.cache
key: ${{ runner.os }}-gatsby-build-develop
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: "2.14.1"
- name: Install wkhtmltopdf
run: |
curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb
sudo apt-get install ./wkhtmltopdf.deb
- name: Install Python dependencies
run: pip install -r requirements-ci.txt
- name: Install PDF Node dependencies
working-directory: ./scripts/pdf
run: |
npm install
- name: Build all pdfs
run: npm run pdf:build-all-ci
- name: Fix mtimes
run: npm run fix-mtimes
- name: Gatsby build
run: npm run build
env:
APP_ENV: staging
NODE_ENV: ${{ secrets.NODE_ENV }}
NODE_OPTIONS: --max-old-space-size=4096
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_INDEX_NAME: edb-docs-staging
INDEX_ON_BUILD: true
- name: Deploy to Netlify
id: netlify-deploy
uses: nwtgck/actions-netlify@v2
with:
publish-dir: "./public"
production-branch: "develop"
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }}
- uses: act10ns/[email protected]
with:
status: ${{ job.status }}
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}