feat: deploy to git-pages instead of SCP (with preview deploys) #17

Merged
radu merged 41 commits from feat/git-pages-deploy into main 2026-07-21 11:48:29 +00:00
Owner

Closes #3

What changes

  • Workflow (build.yml): replaces SCP/SSH deploy with git-pages deployment

    • Builds Hugo, tars public/, PUTs to git-pages via Forge-Authorization
    • Production (push to main): deploys to radu.pages.martin.md/blog, served at blog.martin.md via custom domain
    • Preview (PR): deploys to radu.preview.pages.martin.md/blog@{N} with --baseURL set for correct asset paths
    • Authenticates via Forge-Authorization: Bearer — git-pages verifies the CI token against the Forgejo API
    • Checks out PR branch for preview builds (github.head_ref)
    • Removes all 4 SSH secrets
  • Server config: lives in homelab/dc-git-pages

Preview deployments

PRs deploy to https://radu.preview.pages.martin.md/blog@{N}/ on every push.

Prerequisites

Merged and deployed on kronos:

Cleanup after migration

  1. Remove SSH secrets from repo settings
  2. Remove/repurpose the nginx blog container
Closes #3 ## What changes - **Workflow** (`build.yml`): replaces SCP/SSH deploy with git-pages deployment - Builds Hugo, tars `public/`, PUTs to git-pages via Forge-Authorization - Production (push to main): deploys to `radu.pages.martin.md/blog`, served at `blog.martin.md` via custom domain - Preview (PR): deploys to `radu.preview.pages.martin.md/blog@{N}` with `--baseURL` set for correct asset paths - Authenticates via `Forge-Authorization: Bearer` — git-pages verifies the CI token against the Forgejo API - Checks out PR branch for preview builds (`github.head_ref`) - Removes all 4 SSH secrets - **Server config**: lives in [homelab/dc-git-pages](https://git.martin.md/homelab/dc-git-pages) ## Preview deployments PRs deploy to `https://radu.preview.pages.martin.md/blog@{N}/` on every push. ## Prerequisites Merged and deployed on kronos: - [dc-git-pages#9](https://git.martin.md/homelab/dc-git-pages/pulls/9) — separate preview router + wildcard cert - [dc-traefik#94](https://git.martin.md/homelab/dc-traefik/pulls/94) — DNS-01 Cloudflare challenge ## Cleanup after migration 1. Remove SSH secrets from repo settings 2. Remove/repurpose the nginx blog container
Replace the SSH/SCP deployment with git-pages:
- Push built site to pages branch (production) or
  pages/preview/pr-{N} (preview)
- Notify git-pages via PUT request
- Supports pull_request preview deployments

Removes all SSH secrets and the nginx dependency.
feat: add git-pages configuration
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 21s
ad846382f0
fix(ci): use host IP for git-pages notification
Some checks failed
build.yml / fix(ci): use host IP for git-pages notification (push) Failing after 0s
build.yml / fix(ci): use host IP for git-pages notification (pull_request) Failing after 0s
b0f43e955c
The runner creates ephemeral Docker networks so host.docker.internal
and the bridge gateway are not accessible. Use the host's actual IP
(10.0.50.110) where git-pages is exposed.
fix: expose git-pages on all interfaces for runner access
Some checks failed
build.yml / fix: expose git-pages on all interfaces for runner access (push) Failing after 0s
build.yml / fix: expose git-pages on all interfaces for runner access (pull_request) Failing after 0s
15be75486b
fix: use pages.martin.md as root, blog.martin.md as dedicated wildcard
Some checks failed
build.yml / fix: use pages.martin.md as root, blog.martin.md as dedicated wildcard (push) Failing after 0s
build.yml / fix: use pages.martin.md as root, blog.martin.md as dedicated wildcard (pull_request) Failing after 0s
16ef06d366
fix: pin version, use absolute paths, localhost-only port for webhook
Some checks failed
build.yml / fix: pin version, use absolute paths, localhost-only port for webhook (push) Failing after 0s
build.yml / fix: pin version, use absolute paths, localhost-only port for webhook (pull_request) Failing after 0s
dc3aa7851d
fix(ci): final git-pages workflow - webhook-driven, no runner notification
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 19s
d0850922a0
Push to pages branch (production) or pages/preview/pr-{N} (preview).
A Forgejo webhook to http://127.0.0.1:3000/ triggers git-pages to clone
and serve the pages branch on every push.

No SSH secrets needed. No runner-to-git-pages notification needed.
fix: remove blog.martin.md wildcard, use .domains file instead
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Has been cancelled
16f7bd83d2
feat: add .domains file for blog.martin.md custom domain
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 18s
5c876133ea
git-pages resolves custom domains via a .domains file in the site
root. This eliminates the need for a dedicated [[wildcard]] entry
for blog.martin.md in the git-pages config.
fix: no published ports — webhook goes through Traefik at pages.martin.md
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 19s
72f85e060a
fix: align config path with /srv/docker/volumes/git-pages/config/
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 15s
4aa400aebf
fix: correct git-pages tag (0.9.1, no v prefix)
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Has been cancelled
dd20962024
fix: correct git-pages tag (0.9.1, no v prefix)
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 18s
d22938c1c4
fix: mount config directory instead of single file
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 15s
653797e9c6
Single-file bind mounts fail on this filesystem (possibly zfs/nfs).
Mount the entire config directory and pass -config flag to git-pages.
fix: include binary path in command override
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Has been cancelled
b05e9d866d
fix: full file rewrite with correct command
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 18s
cfaea0bb7d
fix: mount config to /etc/git-pages to avoid container path conflicts
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 15s
10df015c0d
fix: remove preview-domain (not supported in git-pages 0.9.1)
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 19s
0524848df8
fix: back to single-file mount, no -config flag needed
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 14s
eb6d31a733
fix: directory mount + -config flag (works with Portainer)
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 14s
264f9bfbcc
Remove deploy files (moved to homelab/dc-git-pages)
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Has been cancelled
0e49091d4b
Remove deploy files (moved to homelab/dc-git-pages)
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 22s
042fa5c79e
Add git-pages notification step and remove deploy files
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 17s
c5c18402d9
Fix notification URLs to use wildcard subdomain format
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 14s
6e8bbd29c6
Use tar-based PUT with Forge-Authorization (no PAGES_INSECURE needed)
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 17s
1a5e77b5e7
fix: simplify deploy step, add verbose curl debugging
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 12s
f990039cf9
fix: add -k to curl to accept self-signed cert until LE issues one
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 17s
3826fdfd9f
remove -k from curl now that DNS-01 will issue valid certs
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 18s
95a60e8610
fix: remove env block, inline token (v12.7.0 compatibility)
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 17s
22e2d615b5
fix: rename deploy step (no hyphen), add debug echos
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 18s
43d92df3a6
fix: split into Set deploy URL + Deploy steps, avoid bash vars in deploy step
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 18s
e2cd7a790d
fix: remove setup-go to test if it blocks subsequent steps
Some checks failed
Build and deploy website / Build and Deploy Hugo Site (pull_request) Failing after 5s
1b5a232f01
fix: install Go manually instead of uses: to avoid runner exit-code-60 bug
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 12s
03f2143bd4
fix: restore setup-go, use single-line deploy to avoid backslash continuation issue
Some checks failed
build.yml / fix: restore setup-go, use single-line deploy to avoid backslash continuation issue (push) Failing after 0s
build.yml / fix: restore setup-go, use single-line deploy to avoid backslash continuation issue (pull_request) Failing after 0s
07711e3a6c
fix: multiline deploy step, no backslash continuations
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 18s
76f37917c0
fix: set --baseURL for preview deploys so assets resolve correctly
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 19s
e5b10cf298
add temporary preview test post
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 17s
e5e371a7a5
fix: checkout PR branch, not main, for preview builds
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 14s
3760b8fae6
update preview test post to verify redeploy on push
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 18s
f780e9a99e
remove temporary preview test post
All checks were successful
Build and deploy website / Build and Deploy Hugo Site (pull_request) Successful in 13s
b8418c9d05
radu merged commit 092363b412 into main 2026-07-21 11:48:29 +00:00
radu deleted branch feat/git-pages-deploy 2026-07-21 11:48:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
radu/blog!17
No description provided.