Skip to content

update dependencies of workflow #23

update dependencies of workflow

update dependencies of workflow #23

name: deploy-book
# Only run this when the master branch changes
on:
push:
branches:
- master
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install dependencies
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -r requirements.txt
# 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 }}
LOCAL_DIR: "_build/html/"
REMOTE_DIR: ${{ secrets.REMOTE_TARGET2 }}
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