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. 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.
Here's a script (that's very much a WIP!)
export TEMP_SITE="../temp-site"
rm -rf $TEMP_SITE
mkdir -p $TEMP_SITE
cp -R site/build/ $TEMP_SITE/site
cp -R ./img/ $TEMP_SITE/img
cp ./index.html $TEMP_SITE/index.html
cp ./app.css $TEMP_SITE/app.css
cp README.md $TEMP_SITE/README.md
cp CHANGELOG.md $TEMP_SITE/CHANGELOG.md
- Switch to the
main
branch
git checkout main
- Replace everything in the
site
directory of the main branch with contents of the copy of thebuild
directory - Replace
index.html
andapp.css
files
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: