-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.33 KB
/
deploy_webpage.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
name: actions
run-name: Deploy docs
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_SSH_USER: ${{ secrets.REMOTE_SSH_USER }}
REMOTE_IP: ${{ secrets.REMOTE_IP }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install dependencies
run: |
sudo apt install sshpass
pip install virtualenv
virtualenv mkdocs
source mkdocs/bin/activate
pip install -r requirements.txt
pip install --upgrade --force-reinstall mkdocs-material
- name: Create public and private SSH keys
run: |
mkdir ~/.ssh
echo "$SSH_PUBLIC_KEY" > ~/.ssh/id_rsa.pub
echo "$SSH_PRIVATE_KEY" | base64 --decode > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
chmod 0644 ~/.ssh/id_rsa.pub
- name: Build documentation
run: |
./mkdocs/bin/mkdocs build
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site