Deploying (Publishing) Changes
Start a Development Server to test local changes
After you edit the files in VS Code installed on your computer, you can run a server that will serve the site locally on your computer. This is great for testing and to make sure the changes look good before publishing them out to the live site.
In order to build the website you'll need a tool called yarn
. To install yarn, follow the guide here.
Once you have yarn
installed, use the following commands to build and start a server that will serve the site on your computer:
cd site
yarn
yarn start
If all goes well, a browser window should open to show the site. You can also open a browser and go to http://localhost:3000/site/docs/welcome.
Deploy Changes
When you're happy with the changes, you will need to push the changes up to github.
When you use git
to upload changed files, the command that is run is called git push
. So, that's why it's called pushing
code for a release.
There are 2 parts to our site:
- index.html is a basic html page that defines the landing page for https://fahrenheitrobotics.org/
- The site directory contains a docusaurus site which contains our team guides.
There are a few steps to deploy changes to the live site:
This is a bit complicated. It would be great for someone to write a script to automate these steps ;-)
- Run
yarn build
to create abuild
directory containing docusaurus site files - Make a copy of the
build
directory, as well as theindex.html
andapp.css
files. - Switch to the
main
branch - Replace everything in the
site
directory of the main branch with contents of the copy of thebuild
directory - Replace
index.html
andapp.css
files - Push to github
- Create a git tag for the release.
Whenever new or changed files are pushed to github, then the "Live" site available here will show the changes: