-
Notifications
You must be signed in to change notification settings - Fork 237
43 lines (42 loc) · 1.52 KB
/
docs.yaml
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
on:
push:
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- name: mdbook
run: mdbook build
- name: rsync
if: ${{github.event_name=='push' && github.ref=='refs/heads/main' && github.repository_owner == 'sampsyo'}}
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
DEPLOY_SRC: ./book/
DEPLOY_DEST: sync/bril-book
DEPLOY_2_HOST: courses
DEPLOY_2_DEST: coursewww/capra.cs.cornell.edu/htdocs/bril
run: |
echo "$DEPLOY_KEY" > pk
echo "$DEPLOY_KNOWN_HOSTS" > kh
chmod 600 pk
rsync --compress --recursive --checksum --itemize-changes --delete \
-e "ssh -p \"$DEPLOY_PORT\" -i pk -o 'UserKnownHostsFile kh'" \
$DEPLOY_SRC $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DEST
ssh -p $DEPLOY_PORT -i pk -o 'UserKnownHostsFile kh' \
$DEPLOY_USER@$DEPLOY_HOST \
rsync --compress --recursive --checksum --itemize-changes \
--delete -e ssh --perms --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r \
$DEPLOY_DEST/ $DEPLOY_2_HOST:$DEPLOY_2_DEST