Initial deployment refactor [gh action/webhook, git orphan branch]
Closed this issue · 0 comments
yowainwright commented
Description
Currently when doing local development, after any changes are made, or even after running chomp build
, dozens of files will be updated in git. This makes for awkward code review, updates, and onboarding for new engineers.
Solution
- Using a git orphan branch, like Github's standard
gh-pages
, we can use a GitHub action, or other webhooks to update items inpublic_html
after merging to ourmain
branch. - In our
main
branch, and feature branches, we will ignorepublic_html
and git submodules. This will allow engineers to clone GitHub buildpublic_html
for local development but only submit diffs related to html, css, or new docs.
Diagram
sequenceDiagram
actor eng
participant main
participant webhook
participant gh-pages
main->>eng: git checkout -b feature-branch
eng->>eng: make changes
eng->>eng: submodules are cloned but gitignored
eng->>eng: public_html is served for development but gitignored
eng->>main: git push feature-branch
main->>main: code review
main->>main: merge
main->>webhook: kick off jobs
Note over main,webhook: a webhook could be a webhook, gh action, ci, etc
webhook->>webhook: get repo submobules
webhook->>webhook: build updates with submodules to public_html
webhook->>gh-pages: push updates with public_html
gh-pages->>gh-pages: host new deployed updates public_html
References
- https://github.com/yowainwright/codependence
- every merge deploys to a orphan gh-pages branch