commit 5bc24cf89ecec5c80db3f3f72a5f82d157e42c9f Author: ebner Date: Thu Dec 4 14:24:45 2025 +0100 initial commit diff --git a/.gitea/workflows/build_push.yaml b/.gitea/workflows/build_push.yaml new file mode 100644 index 0000000..b00ff3c --- /dev/null +++ b/.gitea/workflows/build_push.yaml @@ -0,0 +1,28 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest-intranet + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: gitea.psi.ch + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: gitea.psi.ch/${{ github.repository }}:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..205887d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine + +# 1. Install Python 3, pip and build tools (needed for packages with C extensions) +RUN apk --no-cache add\ + python3 \ + py3-pip \ + git \ + nodejs + + +# 2. Install the Python packages that were listed in the Debian image +RUN python3 -m venv /opt/python-env +RUN /opt/python-env/bin/python3 -m pip install --upgrade pip + +RUN /opt/python-env/bin/pip install --no-cache-dir \ + zensical + +# 3. (Optional) Clean up if you added any temporary files +RUN rm -rf /var/cache/apk/* diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..d53fc7e --- /dev/null +++ b/Readme.md @@ -0,0 +1,32 @@ +# Overview + +Alpine based image to build jupyter-book based documentation + +Build manually: +```bash +docker run -it --rm -v $(pwd):/data --workdir /data gitea.psi.ch/images/alpine-zensical + +/opt/python-env/bin/zensical build --site-dir public +``` + +Use Gitea action to build the documentation: + +```yaml +jobs: + build-and-deploy: + runs-on: ubuntu-latest-intranet + container: + image: gitea.psi.ch/images/alpine-zensical + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build Jupyter Book + run: /opt/python-env/bin/zensical build --site-dir public + +``` + + +```bash +docker build --platform linux/x86_64 -t gitea.psi.ch/images/alpine-zensical:latest . +```