generated from ubco-cmps/mds_course_template
-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (53 loc) · 1.7 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: deploy-book
# Only run this when the master branch changes
on:
push:
branches:
- main
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install dependencies
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: cache installation
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
pip install -r requirements.txt
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@v1
with:
r-version: '4.1' # The R version to download (if necessary) and use.
- run: Rscript -e "install.packages('IRkernel')"
- run: Rscript -e "IRkernel::installspec()"
# Build the book
- name: Build the book
run: |
jupyter-book build .
# Push to server
- name: rsync and ssh
env:
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
REMOTE_KEY: ${{ secrets.SERVER_SSH_KEY }}
REMOTE_DIR: ${{ secrets.REMOTE_TARGET }}
LOCAL_DIR: "_build/html/"
COURSE_NAME: "data531"
TERM: "2021_WT1"
run: |
mkdir ~/.ssh
echo "$REMOTE_KEY" > ~/.ssh/id_rsa
ssh-keyscan -H $REMOTE_HOST >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/id_rsa
pwd
ls -la
rsync -avzr --delete $LOCAL_DIR $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/courses/$COURSE_NAME/$TERM