Skip to content

Commit

Permalink
expalin how to use
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin committed Oct 8, 2024
1 parent 9ff1b8e commit f1be607
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit f1be607

Please sign in to comment.