diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..83b4b91 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,30 @@ +name: Publish Docker image to Github Container Registry GHCR +on: + release: + types: + - created + +jobs: + push_to_registry: + name: Push Docker image to GHCR + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + # with: # we don't need this + # submodules: "recursive" + - name: get version tag + run: | + VERSION=$(echo ${GITHUB_REF#refs/tags/}) + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Log in to GHCR + # the token has repo:write and package scope and expires on 2025-10-08 + # https://github.com/Hochfrequenz/ebd_toolchain/settings/secrets/actions/GHCR_PUSH_TOKEN + run: echo "${{ secrets.GHCR_PUSH_TOKEN }}" | docker login ghcr.io -u hf-kklein --password-stdin + + - name: Build and push + run: | + docker build -t ebd_toolchain:$VERSION . + docker tag ahbicht-functions:$VERSION ghcr.io/hochfrequenz/ebd_toolchain:$VERSION + docker push ghcr.io/hochfrequenz/ebd_toolchain:$VERSION diff --git a/README.md b/README.md index 5d64dff..e301b0e 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,35 @@ where `-i`, `-o` and `-t` denote the input directory path, the output directory In this repository: 1. create an `.env` file with a structure similar to [`env.example`](env.example). 2. set the environment variables to meaningful values. -3. then run: +3. Create a `docker-compose.yml` with the following content: +```yaml +services: + kroki: + image: yuzutech/kroki:0.24.1 + ports: + - "8125:8000" # Expose Kroki on port 8125 for rendering diagrams + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ] + interval: 10s + timeout: 5s + retries: 3 + + scrape-and-plot: + image: ghcr.io/Hochfrequenz/ebd_toolchain:latest + depends_on: + kroki: + condition: service_healthy + volumes: + - ${EBD_DOCX_FILE}:/container/ebd.docx + - ${OUTPUT_DIR}:/container/output + network_mode: host +``` +4. Login to GitHub Container Registry (GHCR); Use a Personal Access Token (PAT) to login that has access to this repository and at least `read:package` scope +```bash +docker login ghcr.io -u YOUR_GITHUB_USERNAME +``` +5. then run: ```bash -docker-compose build docker-compose up ```