Skip to content

Commit

Permalink
feat: Publish Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Jun 26, 2024
1 parent f156140 commit 92e9f16
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Docker image

on:
release:
types: [published]

permissions:
contents: read

jobs:
push_to_registry:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
- uses: docker/build-push-action@v5
id: push
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.output.labels }}
- uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ so users will not be locked into a proprietary tool or technology.

## Usage

To get started with LD Workbench, first install [NodeJS](https://nodejs.org), then run:
To get started with LD Workbench, you can either use the Docker image or the Node.js package.

To run the Docker image, first create a directory to store your pipeline configurations, then run the Docker image:

```sh
mkdir pipelines
docker run -v $(pwd)/pipelines:/pipelines ghcr.io/netwerk-digitaal-erfgoed/ld-workbench:latest
```

Alternatively, install [Node.js](https://nodejs.org), then run:

```sh
npx @netwerk-digitaal-erfgoed/ld-workbench@latest --init
Expand All @@ -61,7 +70,9 @@ You can find more examples in the [ld-workbench-configuration](https://github.co

#### Iterator

Each stage has a single iterator. The iterator SPARQL SELECT query must return a `$this` binding for each URI that will be passed to the generator(s).
Each stage has a single iterator.
The iterator selects URIs from a dataset that match certain criteria.
The iterator SPARQL SELECT query must return a `$this` binding for each URI that will be passed to the generator(s).

The query can be specified either inline:

Expand Down
23 changes: 23 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:lts-alpine AS build

RUN npm install -g @netwerk-digitaal-erfgoed/ld-workbench@latest

#WORKDIR /app
#COPY package*.json .
#RUN npm ci
#COPY .. .
#RUN NODE_ENV=production npm run compile
#
#FROM node:lts-alpine
#LABEL org.opencontainers.image.source="https://github.com/netwerk-digitaal-erfgoed/ld-workbench"
#ENV NODE_ENV=production
#ENV NPM_CONFIG_UPDATE_NOTIFIER=false
#WORKDIR /app
#COPY package*.json .
#RUN npm ci --ignore-scripts --omit=dev
#COPY --from=build /app/build /app/build
#COPY ../static /app/static/
COPY docker/entrypoint.sh /entrypoint.sh
#USER node
ENTRYPOINT ["/entrypoint.sh"]
#
7 changes: 7 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ -d "/pipelines/configurations/example" ]; then
ld-workbench $@
else
ld-workbench --init
fi

0 comments on commit 92e9f16

Please sign in to comment.