From 2dfee211b1ef99bec07482c50948e0253962d932 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 28 Jul 2024 09:36:30 +0200 Subject: [PATCH 1/3] via .dockerignore --- .dockerignore | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index e4b8c67..0000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -public/ -resources/ -.hugo_build.lock \ No newline at end of file -- 2.45.2 From a276bd111883cd5da3ed2a2edcbb1b58c7437e6e Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 28 Jul 2024 09:36:53 +0200 Subject: [PATCH 2/3] dockerfile non builda hugo --- Dockerfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71f102a..aecb0db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,3 @@ -FROM git.libreschool.org/bglug/hugo-extended:latest AS hugobuild - -COPY . /src - -RUN \ - hugo -s /src --gc --minify - FROM alpine:latest RUN \ @@ -15,7 +8,7 @@ RUN \ chmod -R a-x,a=rX,ug+w /wwwroot /logs COPY docker/rootfs / -COPY --from=hugobuild --chown=nginx:www-data --chmod=a-x,a=rX,ug+w /src/public /wwwroot/ +COPY --chown=nginx:www-data --chmod=a-x,a=rX,ug+w public/ /wwwroot/ # config test RUN nginx -t -- 2.45.2 From ba984a1aa7b82ff118737f5d1e4e861ac79b109f Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 28 Jul 2024 09:39:14 +0200 Subject: [PATCH 3/3] hugo build con caching --- .gitea/workflows/build_and_push.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitea/workflows/build_and_push.yaml b/.gitea/workflows/build_and_push.yaml index 270b238..ae729de 100644 --- a/.gitea/workflows/build_and_push.yaml +++ b/.gitea/workflows/build_and_push.yaml @@ -19,6 +19,24 @@ jobs: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + - uses: actions/cache/restore@v4 + with: + path: | + resources + key: bglug-it-hugo-resources + + - name: Build Hugo + uses: lowply/build-hugo@v0.129.0 + with: + args: --gc --minify --cleanDestinationDir + + - uses: actions/cache/save@v4 + if: always() # salva in cache anche se la build fallisce + with: + path: | + resources + key: bglug-it-hugo-resources + - name: Set up QEMU uses: docker/setup-qemu-action@v3 -- 2.45.2