-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (46 loc) · 1.31 KB
/
build-and-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
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: create .env
run: |
cat <<EOF > .env
ALGOLIA_API_KEY=${{secrets.ALGOLIA_API_KEY}}
ALGOLIA_APP_ID=${{secrets.ALGOLIA_APP_ID}}
ALGOLIA_INDEX=immudb
ALGOLIA_WRIGHT_API_KEY=${{secrets.ALGOLIA_WRIGHT_API_KEY}}
EOF
- uses: actions/setup-node@v2
with:
node-version: "14.18.3"
cache: "npm"
- name: Node version
run: node --version
# cache node_modules
- name: Cache dependencies
uses: actions/cache@v2
id: node-modules-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Node dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm i -f
- name: Build
run: npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
- name: Index algolia
run: npm run algolia:index