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 build
to create abuild
directory 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
build
directory, as well as theindex.html
andapp.css
files.
Take a look at deploy1.sh. This contains the commands to make a copy of the static files.
- 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: