-
Notifications
You must be signed in to change notification settings - Fork 21
59 lines (51 loc) · 1.43 KB
/
deploy-docs.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
name: Deploy docs
on:
push:
branches:
- master
paths:
- '**.js'
- '**.json'
- '**.ts'
- '**.md'
jobs:
start:
runs-on: ubuntu-latest
steps:
- name: Setup ssh agent
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_MACHINE_KEY_DOCS }}"
- name: Setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "EtherspotBOT"
- name: Checkout
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Determine npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Restore npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build docs
run: npm run docs:build
- name: Deploy docs
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
npm run docs:deploy