Skip to content

Commit 4a9402a

Browse files
authored
automate docs website deployment 📚(#24)
1 parent d840cc5 commit 4a9402a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
gh-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: "14.x"
16+
- name: Add key to allow access to repository
17+
env:
18+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
19+
run: |
20+
mkdir -p ~/.ssh
21+
ssh-keyscan github.com >> ~/.ssh/known_hosts
22+
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
23+
chmod 600 ~/.ssh/id_rsa
24+
cat <<EOT >> ~/.ssh/config
25+
Host github.com
26+
HostName github.com
27+
IdentityFile ~/.ssh/id_rsa
28+
EOT
29+
- name: Release to GitHub Pages
30+
env:
31+
USE_SSH: true
32+
GIT_USER: git
33+
run: |
34+
git config --global user.email "actions@gihub.com"
35+
git config --global user.name "gh-actions"
36+
npm install --ignore-scripts
37+
npm run docs
38+
cd website
39+
if [ -e yarn.lock ]; then
40+
yarn install --frozen-lockfile
41+
elif [ -e package-lock.json ]; then
42+
npm ci
43+
else
44+
npm i
45+
fi
46+
yarn deploy

0 commit comments

Comments
 (0)