-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 920 Bytes
/
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
name: Deploy
on:
push:
branches:
- main
env:
MDBOOK_VER: 0.4.37
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install mdBook
run: |
url="https://github.com/rust-lang/mdbook/releases/download/v${{ env.MDBOOK_VER }}/mdbook-v${{ env.MDBOOK_VER }}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: mdbook build
- name: Install SSH key
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- name: Upload Book
run: |
rsync -e "ssh -o StrictHostKeyChecking=no" -r --delete book/ \
${{ vars.SSH_USER }}@${{ vars.SSH_HOST }}:${{ vars.SSH_PATH }}