Skip to content

Commit 949f25d

Browse files
authored
Update for Cinda
1 parent 8d9a1db commit 949f25d

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

.github/workflows/main.yml

+30-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: deploy-book
22

3-
# Only run this when the master branch changes
4-
on:
5-
workflow_dispatch:
6-
push:
7-
branches:
8-
- main
3+
# # Only run this when the master branch changes
4+
# on:
5+
# workflow_dispatch:
6+
# push:
7+
# branches:
8+
# - main
99

1010
# This job installs dependencies, build the book, and pushes it to `gh-pages`
1111
jobs:
@@ -34,19 +34,31 @@ jobs:
3434
run: |
3535
jupyter-book build .
3636
37-
# Push to server
38-
- name: rsync and ssh
37+
# - name: Setup tmate session
38+
# uses: mxschmitt/action-tmate@v3
39+
40+
# Push to CS server
41+
- name: rsync and ssh to CS
3942
env:
40-
REMOTE_HOST: ${{ secrets.FIRAS_REMOTE_HOST }}
41-
REMOTE_USER: ${{ secrets.FIRAS_REMOTE_USER }}
42-
REMOTE_KEY: ${{ secrets.FIRAS_SERVER_SSH_KEY }}
43-
REMOTE_DIR: ${{ secrets.FIRAS_REMOTE_TARGET }}
44-
LOCAL_DIR: "_build/html/"
45-
COURSE_NAME: "cpsc203"
46-
TERM: "2023_WT2"
43+
COURSE_REMOTE_HOST: kunghit.students.cs.ubc.ca
44+
COURSE_REMOTE_USER: cs-221
45+
CS_REMOTE_USER: cheeren
46+
CS_TUNNEL: remote.cs.ubc.ca
47+
REMOTE_KEY: ${{ secrets.FIRAS_SERVER_SSH_KEY }} # TODO
48+
FIRAS_KEYBOARDMBP: ${{ secrets.FIRAS_KEYBOARDMBP }}# TODO
49+
TERM: 2024_W1
50+
LOCAL_DIR: _build/html/
4751
run: |
48-
mkdir ~/.ssh
52+
mkdir -p ~/.ssh
4953
echo "$REMOTE_KEY" > ~/.ssh/id_rsa
50-
ssh-keyscan -H $REMOTE_HOST >> ~/.ssh/known_hosts
5154
chmod 600 ~/.ssh/id_rsa
52-
rsync -avzr --delete $LOCAL_DIR $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/$COURSE_NAME/$TERM
55+
ssh-keyscan -H $CS_TUNNEL >> ~/.ssh/known_hosts
56+
57+
echo "$FIRAS_KEYBOARDMBP" > ~/.ssh/id_ed25519
58+
chmod 600 ~/.ssh/id_ed25519
59+
60+
# Set up a tunnel in the background
61+
ssh -fN -L 2222:$COURSE_REMOTE_HOST:22 [email protected] -p 22
62+
63+
# send files all in one shot
64+
rsync -avzr -e 'ssh -p 22 -o StrictHostKeyChecking=no -J $CS_REMOTE_USER@$CS_TUNNEL' $LOCAL_DIR $COURSE_REMOTE_USER@$COURSE_REMOTE_HOST:public_html/$TERM

0 commit comments

Comments
 (0)