From 2d1d8427387c2c0bc229683ce84249f727921107 Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:21:49 +0100 Subject: [PATCH] Add deployment action Move to root Foo Move to root Setup go Minio More minio Fix vars --- .forgejo/workflows/ci.yml | 26 +++++++++++++++++++ .gitignore | 14 ++++++++++ {hugo/archetypes => archetypes}/default.md | 0 {hugo/config => config}/_default/hugo.toml | 0 .../_default/languages.en.toml | 0 {hugo/config => config}/_default/markup.toml | 0 .../config => config}/_default/menus.en.toml | 0 {hugo/config => config}/_default/module.toml | 0 {hugo/config => config}/_default/params.toml | 0 .../posts/my-first-post.md | 0 hugo/go.mod => go.mod | 0 hugo/go.sum => go.sum | 0 hugo/.gitignore | 13 ---------- 13 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 .forgejo/workflows/ci.yml rename {hugo/archetypes => archetypes}/default.md (100%) rename {hugo/config => config}/_default/hugo.toml (100%) rename {hugo/config => config}/_default/languages.en.toml (100%) rename {hugo/config => config}/_default/markup.toml (100%) rename {hugo/config => config}/_default/menus.en.toml (100%) rename {hugo/config => config}/_default/module.toml (100%) rename {hugo/config => config}/_default/params.toml (100%) rename {hugo/content => content}/posts/my-first-post.md (100%) rename hugo/go.mod => go.mod (100%) rename hugo/go.sum => go.sum (100%) delete mode 100644 hugo/.gitignore diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..c06fea4 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,26 @@ +on: [push, pull_request] + +name: Homepage deployment + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "^1.23.3" + - name: Setup Minio Client + run: wget https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x mc && cp mc /usr/local/bin + - name: Clone repository + uses: actions/checkout@v4 + - name: Setup Hugo + uses: https://github.com/peaceiris/actions-hugo@v3 + with: + hugo-version: "0.139.3" + - name: Build + run: hugo --minify + - name: Add Minio credentials + run: mc alias set deploy "${{ vars.MINIO_ENDPOINT }}" "${{ secrets.MINIO_ACCESS_KEY }}" "${{ secrets.MINIO_SECRET_KEY }}" + - name: Deploy + run: mc mirror --overwrite ./public deploy/homepage-source diff --git a/.gitignore b/.gitignore index fd28df8..ba20f71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,16 @@ .env .direnv/ + +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock diff --git a/hugo/archetypes/default.md b/archetypes/default.md similarity index 100% rename from hugo/archetypes/default.md rename to archetypes/default.md diff --git a/hugo/config/_default/hugo.toml b/config/_default/hugo.toml similarity index 100% rename from hugo/config/_default/hugo.toml rename to config/_default/hugo.toml diff --git a/hugo/config/_default/languages.en.toml b/config/_default/languages.en.toml similarity index 100% rename from hugo/config/_default/languages.en.toml rename to config/_default/languages.en.toml diff --git a/hugo/config/_default/markup.toml b/config/_default/markup.toml similarity index 100% rename from hugo/config/_default/markup.toml rename to config/_default/markup.toml diff --git a/hugo/config/_default/menus.en.toml b/config/_default/menus.en.toml similarity index 100% rename from hugo/config/_default/menus.en.toml rename to config/_default/menus.en.toml diff --git a/hugo/config/_default/module.toml b/config/_default/module.toml similarity index 100% rename from hugo/config/_default/module.toml rename to config/_default/module.toml diff --git a/hugo/config/_default/params.toml b/config/_default/params.toml similarity index 100% rename from hugo/config/_default/params.toml rename to config/_default/params.toml diff --git a/hugo/content/posts/my-first-post.md b/content/posts/my-first-post.md similarity index 100% rename from hugo/content/posts/my-first-post.md rename to content/posts/my-first-post.md diff --git a/hugo/go.mod b/go.mod similarity index 100% rename from hugo/go.mod rename to go.mod diff --git a/hugo/go.sum b/go.sum similarity index 100% rename from hugo/go.sum rename to go.sum diff --git a/hugo/.gitignore b/hugo/.gitignore deleted file mode 100644 index 86c95ef..0000000 --- a/hugo/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# Generated files by hugo -/public/ -/resources/_gen/ -/assets/jsconfig.json -hugo_stats.json - -# Executable may be added to repository -hugo.exe -hugo.darwin -hugo.linux - -# Temporary lock file while building -/.hugo_build.lock