Deploying (Publishing) Changes
When you're happy with the changes, you will need to push the changes up to github.
note
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:
note
This is a bit complicated so I wrote some scripts to automate it.
- Run
yarn buildto create abuilddirectory containing docusaurus site files
Take a look at deploy0.sh. This contains the commands to build the docusaurus files into static html/css/javascript.
- Make a copy of the
builddirectory, as well as theindex.htmlandapp.cssfiles.
Take a look at deploy1.sh. This contains the commands to make a copy of the static files.
- Switch to the
mainbranch
git checkout main
- Replace everything in the
sitedirectory of the main branch with contents of the copy of thebuilddirectory - Replace
index.htmlandapp.cssfiles
export TEMP_SITE="../temp-site"
rm -rf site/
mv $TEMP_SITE/site site
rm -rf img/
mv $TEMP_SITE/img img
mv $TEMP_SITE/index.html index.html
mv $TEMP_SITE/app.css app.css
mv $TEMP_SITE/README.md README.md
mv $TEMP_SITE/CHANGELOG.md CHANGELOG.md
- Push to github
git push origin main
- Create a git tag for the release.
git push origin <NEW_TAG>
Whenever new or changed files are pushed to github, then the "Live" site available here will show the changes: