From 63016c1dd8134a08428f20ef4f2c0fceaf702e9c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 5 Dec 2025 08:53:31 +0100 Subject: [PATCH] build container image in pipeline --- .forgejo/workflows/build.yml | 33 ++++++++++++++++++++++++++++++++- Dockerfile | 5 +++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 1195f92..ac90643 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -30,6 +30,37 @@ jobs: - name: Upload site artifact uses: forgejo/upload-artifact@v4 with: - name: docs + name: docs.zip path: site/ retention-days: 30 + + docker: + runs-on: ubuntu-latest + needs: build + container: catthehacker/ubuntu:act-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Download site artifact + uses: forgejo/download-artifact@v4 + with: + name: docs.zip + path: site/ + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.CONTAINER_REGISTRY }} + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ vars.CONTAINER_REGISTRY }}/servala/documentation:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20ba343 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM docker.io/caddy:latest + +COPY site/ /usr/share/caddy/ + +EXPOSE 80