summaryrefslogtreecommitdiffstats
path: root/WORKFLOW.md
diff options
context:
space:
mode:
Diffstat (limited to 'WORKFLOW.md')
-rw-r--r--WORKFLOW.md40
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