diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml new file mode 100644 index 0000000..ffcac16 --- /dev/null +++ b/.gitea/workflows/publish.yml @@ -0,0 +1,37 @@ +# Published to fam/blog:.gitea/workflows/publish.yml by app/hugo/install. +# Runs on the gnoc-host act_runner (host mode — job executes directly in +# the gnoc user's shell), so we can rsync into /var/gnoc/hugo-public where +# the gnoc-hugo nginx pod reads via hostPath. + +name: publish + +on: + push: + branches: [main] + +jobs: + build-and-publish: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 1 + + - name: Install Hugo + run: | + set -euo pipefail + HUGO_VERSION=0.147.6 + TAR="hugo_extended_0.147.6_linux-amd64.tar.gz" + curl -fsSL -o "$RUNNER_TEMP/hugo.tar.gz" \ + "https://github.com/gohugoio/hugo/releases/download/v0.147.6/${TAR}" + tar -xzf "$RUNNER_TEMP/hugo.tar.gz" -C "$RUNNER_TEMP" hugo + echo "$RUNNER_TEMP" >> "$GITHUB_PATH" + + - name: Build + run: hugo --minify --gc + + - name: Publish + run: | + set -euo pipefail + rsync -az --delete public/ /var/gnoc/hugo-public/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..89af1b0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/PaperMod"] + path = themes/PaperMod + url = https://github.com/adityatelange/hugo-PaperMod.git diff --git a/content/posts/hello.md b/content/posts/hello.md new file mode 100644 index 0000000..95d5a01 --- /dev/null +++ b/content/posts/hello.md @@ -0,0 +1,7 @@ +--- +title: "Hello from gnoc" +date: 2026-04-16 +draft: false +--- + +这是 `gnoc-hugo` 的第一篇文章。后续文章由 agent 通过 PR 流程提交,runner 自动发布。 diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..56323a2 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,13 @@ +baseURL = "https://famzheng.com/" +languageCode = "zh" +title = "gnoc" +theme = "PaperMod" + +[pagination] + pagerSize = 10 + +[params] + env = "production" + defaultTheme = "auto" + showReadingTime = true + showCodeCopyButtons = true diff --git a/themes/PaperMod b/themes/PaperMod new file mode 160000 index 0000000..f207ce6 --- /dev/null +++ b/themes/PaperMod @@ -0,0 +1 @@ +Subproject commit f207ce6d58899e1498af1c569d46ed7ee56d6966