Migrate blog deployment to git-pages #3

Open
opened 2026-04-28 11:10:47 +00:00 by radu · 0 comments
Owner

Context

The blog currently deploys via a Forgejo Action that builds Hugo and SCPs the public/ directory to /srv/docker/nginx/html/blog on a remote server. This requires:

  • 4 SSH secrets (host, port, user, private key)
  • An nginx container serving the static files
  • The garygrossgarten/github-action-scp action

git-pages is a static site server designed for Git forges (Forgejo/Gitea). It eliminates the SCP step and the nginx dependency.

Current Setup

.forgejo/workflows/build.yml:

  1. Build Hugo (hugo --minify --gc)
  2. SCP public/ to remote nginx via SSH
  3. nginx serves the files

Moving parts: Forgejo runner + SCP + 4 SSH secrets + nginx container

Proposed Setup

  1. Build Hugo (same as today)
  2. Push output to a pages branch or upload as archive to git-pages
  3. git-pages serves the site directly

Moving parts: Forgejo runner + git push/upload (no secrets needed beyond a deploy token)

Benefits

  • Eliminate SSH-based deployment — no more managing SSH keys in Forgejo secrets
  • Drop nginx for the blog (or reduce its role if it serves other things)
  • Simpler workflow — build + push, no SCP
  • Atomic deploys — git-pages uses manifest-based updates, no partial SCP states

Things to Figure Out

  • URL path: currently served at a subpath under nginx. git-pages uses <hostname>/ or <hostname>/<project>/ — may need a subdomain like blog.martin.md
  • TLS routing: git-pages includes Caddy for TLS, but Traefik already handles this. Proxy through Traefik to git-pages, or let git-pages handle its own TLS?
  • git-pages deployment: run as a Docker container on kronos, or alongside the blog repo?
  • Does nginx serve anything else? If the blog is the only thing, it's a clean swap. If not, nginx stays for the rest.

Tasks

  • Deploy git-pages container (evaluate standalone vs behind Traefik)
  • Decide on URL scheme (subpath vs subdomain)
  • Configure DNS if switching to subdomain
  • Update Forgejo workflow: replace SCP step with git-pages push/upload
  • Remove SSH secrets from Forgejo repo settings
  • Verify site works end-to-end
  • Remove/repurpose nginx container if no longer needed
## Context The blog currently deploys via a Forgejo Action that builds Hugo and SCPs the `public/` directory to `/srv/docker/nginx/html/blog` on a remote server. This requires: - 4 SSH secrets (host, port, user, private key) - An nginx container serving the static files - The `garygrossgarten/github-action-scp` action [git-pages](https://codeberg.org/git-pages/git-pages) is a static site server designed for Git forges (Forgejo/Gitea). It eliminates the SCP step and the nginx dependency. ## Current Setup `.forgejo/workflows/build.yml`: 1. Build Hugo (`hugo --minify --gc`) 2. SCP `public/` to remote nginx via SSH 3. nginx serves the files **Moving parts:** Forgejo runner + SCP + 4 SSH secrets + nginx container ## Proposed Setup 1. Build Hugo (same as today) 2. Push output to a `pages` branch or upload as archive to git-pages 3. git-pages serves the site directly **Moving parts:** Forgejo runner + git push/upload (no secrets needed beyond a deploy token) ## Benefits - **Eliminate SSH-based deployment** — no more managing SSH keys in Forgejo secrets - **Drop nginx** for the blog (or reduce its role if it serves other things) - **Simpler workflow** — build + push, no SCP - **Atomic deploys** — git-pages uses manifest-based updates, no partial SCP states ## Things to Figure Out - **URL path**: currently served at a subpath under nginx. git-pages uses `<hostname>/` or `<hostname>/<project>/` — may need a subdomain like `blog.martin.md` - **TLS routing**: git-pages includes Caddy for TLS, but Traefik already handles this. Proxy through Traefik to git-pages, or let git-pages handle its own TLS? - **git-pages deployment**: run as a Docker container on kronos, or alongside the blog repo? - **Does nginx serve anything else?** If the blog is the only thing, it's a clean swap. If not, nginx stays for the rest. ## Tasks - [ ] Deploy git-pages container (evaluate standalone vs behind Traefik) - [ ] Decide on URL scheme (subpath vs subdomain) - [ ] Configure DNS if switching to subdomain - [ ] Update Forgejo workflow: replace SCP step with git-pages push/upload - [ ] Remove SSH secrets from Forgejo repo settings - [ ] Verify site works end-to-end - [ ] Remove/repurpose nginx container if no longer needed
Sign in to join this conversation.
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#3
No description provided.