-
Notifications
You must be signed in to change notification settings - Fork 237
59 lines (57 loc) · 1.67 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: docs
on:
push:
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- name: mdbook
run: mdbook build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: book
path: book
deploy:
needs: build
runs-on: ubuntu-latest
if: ${{github.event_name=='push' && github.ref=='refs/heads/main' && github.repository_owner == 'sampsyo'}}
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: book
path: book
- run: ls -R
- name: rsync
env:
DEPLOY_HOST: courses.cit.cornell.edu
DEPLOY_USER: als485
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
DEPLOY_SRC: ./book/
DEPLOY_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 \
--perms --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r \
-e "ssh -i pk -o 'UserKnownHostsFile kh'" \
$DEPLOY_SRC $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DEST