diff --git a/.dockerignore b/.dockerignore index e4b8c67..8dd6d56 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,2 @@ public/ -resources/ -.hugo_build.lock \ No newline at end of file +.hugo_build.lock diff --git a/.gitea/workflows/build_and_push.yaml b/.gitea/workflows/build_and_push.yaml index 270b238..aea47c2 100644 --- a/.gitea/workflows/build_and_push.yaml +++ b/.gitea/workflows/build_and_push.yaml @@ -3,8 +3,8 @@ name: Container Publish on: push: - tags: - - 'live' + # tags: + # - 'live' schedule: - cron: "0 12 * * *" @@ -19,18 +19,23 @@ jobs: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + - uses: actions/cache@v3 + with: + path: .resources/ + key: bglug-it-hugo-resources + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker BuildX uses: docker/setup-buildx-action@v3 - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: git.libreschool.org - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_TOKEN }} + # - name: Login to registry + # uses: docker/login-action@v3 + # with: + # registry: git.libreschool.org + # username: ${{ secrets.REGISTRY_USER }} + # password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and publish uses: docker/build-push-action@v5 @@ -38,13 +43,13 @@ jobs: context: . file: ./Dockerfile platforms: linux/amd64 - push: true - tags: git.libreschool.org/bglug/bglug.it:latest + push: false + tags: git.libreschool.org/paspo/bglug.it:latest - name: send mattermost notification uses: mattermost/action-mattermost-notify@master with: MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} TEXT: | - :white_check_mark: `${{ github.repository }}` A new container image has been pushed to `git.libreschool.org/bglug/bglug.it:latest` + :white_check_mark: `${{ github.repository }}` A new container image has been pushed to `git.libreschool.org/paspo/bglug.it:latest` MATTERMOST_ICON: https://cdn3.iconfinder.com/data/icons/system-basic-vol-4-1/20/icon-note-attention-alt3-512.png diff --git a/Dockerfile b/Dockerfile index 71f102a..559e031 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ FROM git.libreschool.org/bglug/hugo-extended:latest AS hugobuild COPY . /src RUN \ - hugo -s /src --gc --minify + mkdir -p /out && \ + hugo -s /src --gc --minify --cleanDestinationDir -d /out FROM alpine:latest @@ -15,7 +16,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 --from=hugobuild --chown=nginx:www-data --chmod=a-x,a=rX,ug+w /out /wwwroot/ # config test RUN nginx -t