diff --git a/.forgejo/workflows/docs.yaml b/.forgejo/workflows/docs.yaml new file mode 100644 index 0000000..e8b925a --- /dev/null +++ b/.forgejo/workflows/docs.yaml @@ -0,0 +1,38 @@ +name: Build Antora Docs + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - 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@v5 + with: + context: . + file: docs/Dockerfile + push: true + tags: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_NAME_DOCS }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000..d167850 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,14 @@ +# ---------- STEP 1 ---------- +# Build the documentation in web format +FROM ghcr.io/vshn/antora:master AS antora + +WORKDIR /build +COPY . /build +RUN make docs-html antora_cmd=antora antora_opts=--fetch + +# ---------- STEP 2 ---------- +# Docker image only containing nginx and the freshly built documentation +FROM ghcr.io/vshn/nginx:latest + +# Finally, copy the contents of the documentation to be served +COPY --from=antora /build/_public /usr/share/nginx/html