I am setting up a documentation website, using GitHub Pages + Docusaurus (static website generator).
There are two github repositories involved: "DOCS" for the staging version of the website (dev.docs.com) and "DOCS-PRODUCTION" for hosting the production version (docs.com). All the "magic" happens in "DOCS" repository, devs clone it, push, pull, etc. When it's ready for a 'release', the idea is to do git push production main
and have the latest version live.
However, some (configuration) files need to be different for staging ("DOCS" repo) and production ("DOCS-PRODUCTION") versions of the website. How to achieve this?
I've seen the hijacking method using the git update-index --assume-unchanged <filename>
, but don't know how to apply it in my situation. Steps I've done so far:
- create empty "DOCS" github repository
- create empty "DOCS-PRODUCTION" github repository
- create simple website; git init;
git add remote origin <DOCS URL>
; git push git add remote production <DOCS-PRODUCTION URL>
How to go from here in order to have one version of the config file in the staging repo and a different, "fixed" version of config in the production repo?