Skip to content

Commit

Permalink
Update main.yml to use GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
firasm authored Jan 6, 2025
1 parent 87bb9d7 commit c0bb6da
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,38 @@ jobs:
- name: Build the book
run: |
jupyter-book build .
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html

# Push to server
- name: rsync and ssh
env:
REMOTE_HOST: ${{ secrets.FIRAS_REMOTE_HOST }}
REMOTE_USER: ${{ secrets.FIRAS_REMOTE_USER }}
REMOTE_KEY: ${{ secrets.FIRAS_SERVER_SSH_KEY }}
REMOTE_DIR: ${{ secrets.FIRAS_REMOTE_TARGET }}
LOCAL_DIR: "_build/html/"
COURSE_NAME: "cpsc203"
TERM: "2023_WT2"
run: |
mkdir ~/.ssh
echo "$REMOTE_KEY" > ~/.ssh/id_rsa
ssh-keyscan -H $REMOTE_HOST >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/id_rsa
rsync -avzr --delete $LOCAL_DIR $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/$COURSE_NAME/$TERM
# # Push to CS server
# - name: rsync and ssh to CS
# env:
# COURSE_REMOTE_HOST: kunghit.students.cs.ubc.ca
# COURSE_REMOTE_USER: cs-330
# CS_REMOTE_USER: firasm
# CS_TUNNEL: remote.cs.ubc.ca
# REMOTE_KEY: ${{ secrets.FIRAS_SERVER_SSH_KEY }}
# FIRAS_KEYBOARDMBP: ${{ secrets.FIRAS_KEYBOARDMBP }}
# TERM: 2024_W1
# LOCAL_DIR: _build/html/
# run: |
# mkdir -p ~/.ssh
# echo "$REMOTE_KEY" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh-keyscan -H $CS_TUNNEL >> ~/.ssh/known_hosts

# echo "$FIRAS_KEYBOARDMBP" > ~/.ssh/id_ed25519
# chmod 600 ~/.ssh/id_ed25519

# # Set up a tunnel in the background
# ssh -fN -L 2222:$COURSE_REMOTE_HOST:22 $CS_REMOTE_USER@$CS_TUNNEL -p 22

# # send files all in one shot
# 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 comments on commit c0bb6da

Please sign in to comment.