RCDE Workshops
This site is created using jupyter-book.
Working Locally with Conda
A build script is set up in build.sh
. To create the build environment, run:
$ conda create -n jupyter-book python==3.10.0
$ source activate jupyter-book
$ conda install -c conda-forge jupyter-book
$ conda install numpy matplotlib pandas
$ pip install ghp-import
Building Locally
To build the workshop site and test it locally, run:
$ ./build.sh
Deploying Locally
To deploy the workshop to GitHub page, run:
$ ./build.sh pages
Working Locally with Docker
You can build and develop this site locally without installing any of the Python dependencies on your machine by using the Docker interface.
Setting up the Docker Environment
Before getting started, you will need to build the Docker image. This image
will contain all of the dependencies for the project, so you will need to
repeat this step whenever the dependencies in requirements.txt
change.
To build the image, run:
make docker
Live Development Server with Docker
The Docker setup for this project includes a live reload server that will serve the site on localhost:8080 and automatically re-build the site whenever you change a file.
To run the live server, run:
make docker-dev-server
An initial build will run before the server starts. After it is finished, you can view the site at localhost:8080.
The site will re-build automatically when you change any file. The web browser will automatically refresh the page when this occurs.
When you are done, press Ctrlc to stop the server.
Cleaning with Docker
Sometimes, it is necessary to clear the site's build cache. A script is available to do this for you. Just run:
make docker-clean
Building with Docker
To build the site, but not start the development webserver, you can use the build command. Just run:
make docker-build
Deploying with Docker
To deploy the site, we use the ghp-import
package. The import process will
run in the container, then we will push from your local computer so that your
saved credentials are used (if present).
make docker-deploy