diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-28 10:38:08 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-28 10:38:08 +0200 |
| commit | ba462ddcef07445294d4e19ca0c5d440d8c51b12 (patch) | |
| tree | fcaaecfb49693f08d19dadc105d754e4dd923c35 /WORKFLOW.md | |
| parent | da66ef2a6fc569587bd611a9c7f2d78b371f69a7 (diff) | |
| download | danixxyz-ba462ddcef07445294d4e19ca0c5d440d8c51b12.tar.gz danixxyz-ba462ddcef07445294d4e19ca0c5d440d8c51b12.zip | |
docs: update git workflow for production branch strategy
Replace master-as-deploy with three-branch model: feature branches →
master (staging) → production (live). Master no longer triggers deploy.
Updated CLAUDE.md, AGENTS.md, WORKFLOW.md, and all docs/policies files
to reflect production branch approach. Includes deployment commands and
updated FAQ.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'WORKFLOW.md')
| -rw-r--r-- | WORKFLOW.md | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/WORKFLOW.md b/WORKFLOW.md index f8e6fee..6743d9d 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -12,9 +12,19 @@ That directory is a full clone of `danix2-hugo-theme` — you can push from ther --- +## Branches + +Three branches govern the site: + +| Branch | Purpose | Push Triggers Deploy | +|--------|---------|---------------------| +| `master` | Staging/dev. Feature branches merge here. Safe for WIP. | No | +| `production` | Live branch. Merges from master only, when ready to ship. | **Yes** | +| `feature/*` or `week-*-*` | Work branches. Merge to master when done. | No | + ## Working on Content -All content work happens in `~/Programming/GIT/danix.xyz-hacker-theme/`. +All content work happens in `~/Programming/GIT/danix.xyz-hacker-theme/`, committed to a feature branch or directly to `master`. Master does not trigger deploy — only `production` does. ### Add a new article @@ -24,7 +34,7 @@ hugo new content/en/articles/my-new-article/index.md # write the article, add images to the same directory git add content/en/articles/my-new-article/ git commit -m "content: add article 'my-new-article'" -git push origin master +git push origin master # or push feature branch ``` ### Edit an existing article @@ -138,20 +148,26 @@ git push origin master ## Production Deployment -Pushing to `danix_git:danix.xyz-2` (master) triggers the `post-receive` hook on the server. +Pushing to the `production` branch triggers the `post-receive` hook on the server. + +```bash +git checkout production +git merge master # bring production up to date with master +git push origin production +``` The hook: 1. Creates a fresh Hugo site in `/tmp/danix.xyz-compile` -2. Checks out the content repo there +2. Checks out the content repo at `production` branch 3. Clones the **latest tip of `danix2-hugo-theme` master** into `themes/dagreynix` 4. Runs `hugo -t dagreynix --minify` 5. Publishes to `/var/www/html` **Important:** The hook always clones the current tip of the theme repo — it does NOT use the submodule pointer. This means: -- Pushing a theme change to `danix_git:danix2-hugo-theme` is enough for production to pick it up on the next content deploy. +- Pushing a theme change to `danix_git:danix2-hugo-theme` is enough for production to pick it up on the next production deploy. - You do NOT need to bump the submodule pointer to deploy theme changes. The pointer is for local tracking only. -- If you want to deploy a theme change immediately without a content change, make any trivial commit in the content repo and push it. +- If you want to deploy a theme change immediately without a content change, merge master to production and push (even if no content changed). --- @@ -232,17 +248,23 @@ ssh danix_git "git -C ~/repositories/danix2-hugo-theme.git log --oneline | head ## Quick Reference ``` -# content change → deploy +# content change → staging (master) cd ~/Programming/GIT/danix.xyz-hacker-theme git add <files> && git commit -m "..." && git push origin master -# theme change → deploy +# content/config → production (deploy to live) +cd ~/Programming/GIT/danix.xyz-hacker-theme +git checkout production && git merge master && git push origin production + +# theme change → staging, then production cd ~/Programming/GIT/danix2-hugo-theme # or themes/danix-xyz-hacker/ git checkout master git add <files> && git commit -m "..." && git push origin master -# then bump pointer: +# then bump pointer and push to master: cd ~/Programming/GIT/danix.xyz-hacker-theme git add themes/danix-xyz-hacker && git commit -m "chore: bump theme" && git push origin master +# then deploy to production: +git checkout production && git merge master && git push origin production # check submodule status git submodule status |
