Skip to content

Build and Deploy Cress Via GitHub Pages

Yinan Zhou edited this page May 27, 2024 · 1 revision

To manage the various dependencies and resources, Cress needs to be built by webpack.

Local

The configurations for building Cress locally can be found in webpack.config.js. http-server is used as a lightweight static HTTP server to run Cress web app locally. The root of the server is located at deployment/server/. To build and start Cress locally, run:

yarn build && yarn start

You can access Cress via port 9000.

Note: if changes are not updated, run yarn cache clean to clean cache, and do Empty Cache and Hard Reload in inspect mode in Chrome.

GitHub Pages

Cress is hosted on GitHub pages. webpack.pages-config.js contains the configurations for building Cress for GitHub pages. Note that GitHub pages fetch resources at the root level, not {hostname}/Cress/, so the asset path and output path has to be set to /Cress/Cress-gh/.

To update GitHub Pages:

  1. From main branch with the latest updates, bundle Cress by running
yarn bundle:pages

The output will be saved to /gh-pages/Cress/Cress-gh/.

  1. Copy /gh-pages/Cress/Cress-gh/ folder and store it outside of the Cress repository

  2. Switch to gh-pages branch by running

git checkout gh-pages
  1. Replace folder Cress-gh at the root level with the new folder

  2. Commit and push changes

If developing .html files, make sure to also update

  • index.html
  • dashboard.html
  • editor.html
Clone this wiki locally