-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (37 loc) · 1.11 KB
/
main.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
name: Automatic Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v1
- name: Install GitBook
run: |
npm install -g gitbook-cli
gitbook install
- name: Generate
run: |
gitbook build
- name: Deploy to Github Pages
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: _book
GITHUB_TOKEN: ${{ secrets.GH_PUSH_KEY_MISSING }}
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.SERVER_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -t ed25519 ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
- name: Deploy to Server
run: |
cd ./_book
rsync -avz --delete ./ ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:${{ secrets.SERVER_MISSING_PATH }}