diff options
Diffstat (limited to 'WORKFLOW.md')
| -rw-r--r-- | WORKFLOW.md | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/WORKFLOW.md b/WORKFLOW.md index 13a6da3..f142fcd 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -25,6 +25,8 @@ hugo new content/en/articles/my-new-article/index.md git add content/en/articles/my-new-article/ git commit -m "content: add article 'my-new-article'" git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master ``` ### Edit an existing article @@ -35,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 @@ -44,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) @@ -55,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) @@ -64,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 @@ -173,7 +183,7 @@ git push origin master ## Production Deployment -Pushing to `danix_git:danix.xyz-2` (master) triggers the `post-receive` hook on the server. +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` @@ -182,11 +192,17 @@ The hook: 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 content 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, make any trivial commit in the content repo and push it. +- 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. --- @@ -270,14 +286,17 @@ ssh danix_git "git -C ~/repositories/danix2-hugo-theme.git log --oneline | head # 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 # 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: +# 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: +git checkout production && git merge master && git push origin production && git checkout master # check submodule status git submodule status |
