summaryrefslogtreecommitdiffstats
path: root/WORKFLOW.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-29 13:32:29 +0200
committerDanilo M. <danix@danix.xyz>2026-04-29 13:32:29 +0200
commit94d02d50ba9f84f7dfbb15c2743b493fd3a30334 (patch)
tree7d814c3e06a6c6c59e301256669b1871b0c4cb65 /WORKFLOW.md
parentfb98e1e94d624605ba6ea75daf5e8ce0400fa629 (diff)
parent15c7acd20849b13ab445ff8555ace5fb22a3ad7a (diff)
downloaddanixxyz-release_29042026-1332.tar.gz
danixxyz-release_29042026-1332.zip
docs: update WORKFLOW.md for production branch deploy + fix hugo.toml gitrepo paramsrelease_29042026-1332
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'WORKFLOW.md')
-rw-r--r--WORKFLOW.md59
1 files changed, 28 insertions, 31 deletions
diff --git a/WORKFLOW.md b/WORKFLOW.md
index e7cafd5..f142fcd 100644
--- a/WORKFLOW.md
+++ b/WORKFLOW.md
@@ -12,19 +12,9 @@ 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/`, committed to a feature branch or directly to `master`. Master does not trigger deploy — only `production` does.
+All content work happens in `~/Programming/GIT/danix.xyz-hacker-theme/`.
### Add a new article
@@ -34,7 +24,9 @@ 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 # or push feature branch
+git push origin master
+# then deploy:
+git checkout production && git merge master && git push origin production && git checkout master
```
### Edit an existing article
@@ -45,6 +37,8 @@ cd ~/Programming/GIT/danix.xyz-hacker-theme
git add content/en/articles/my-article/index.md
git commit -m "content: update 'my-article'"
git push origin master
+# then deploy:
+git checkout production && git merge master && git push origin production && git checkout master
```
### Delete an article
@@ -54,6 +48,8 @@ cd ~/Programming/GIT/danix.xyz-hacker-theme
git rm -r content/en/articles/my-article/
git commit -m "content: remove 'my-article'"
git push origin master
+# then deploy:
+git checkout production && git merge master && git push origin production && git checkout master
```
### Add a static asset (image, font, file)
@@ -65,6 +61,8 @@ cp ~/Downloads/photo.jpg static/images/photo.jpg
git add static/images/photo.jpg
git commit -m "content: add photo.jpg"
git push origin master
+# then deploy:
+git checkout production && git merge master && git push origin production && git checkout master
```
### Update site config (hugo.toml, i18n strings)
@@ -74,6 +72,8 @@ git push origin master
git add hugo.toml
git commit -m "config: ..."
git push origin master
+# then deploy:
+git checkout production && git merge master && git push origin production && git checkout master
```
### Mark an article as obsolete
@@ -183,26 +183,26 @@ git push origin master
## Production Deployment
-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
-```
+Pushing to `danix_git:danix.xyz-2` **production branch** triggers the `post-receive` hook on the server. Pushing to `master` alone does NOT deploy.
The hook:
1. Creates a fresh Hugo site in `/tmp/danix.xyz-compile`
-2. Checks out the content repo at `production` branch
+2. Checks out the content repo there
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`
+**Deploy workflow:** commit to master first, then merge into production and push:
+
+```bash
+git checkout production && git merge master && git push origin production && git checkout master
+```
+
**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 production deploy.
+- Pushing a theme change to `danix_git:danix2-hugo-theme` is enough for production to pick it up on the next 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, merge master to production and push (even if no content changed).
+- If you want to deploy a theme change immediately without a content change, make any trivial commit in the content repo, push to master, then merge to production.
---
@@ -283,23 +283,20 @@ ssh danix_git "git -C ~/repositories/danix2-hugo-theme.git log --oneline | head
## Quick Reference
```
-# content change → staging (master)
+# content change → deploy
cd ~/Programming/GIT/danix.xyz-hacker-theme
git add <files> && git commit -m "..." && git push origin master
+git checkout production && git merge master && git push origin production && git checkout master
-# 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
+# theme change → deploy
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 and push to master:
+# then bump pointer in content repo:
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
+# then deploy:
+git checkout production && git merge master && git push origin production && git checkout master
# check submodule status
git submodule status