Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

chore: update Dockerfile #835

chore: update Dockerfile

chore: update Dockerfile #835

name: EDC Image CI
on:
push:
branches: [ main ]
release:
types: [ published ]
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io
IMAGE_NAME_BASE: ${{ github.repository_owner }}
IMAGE_NAME: edc
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
matrix:
imageVariants: [
{
"imageName": "broker-server-dev",
"title": "Broker Server (Dev)",
"description": "EDC IDS Broker Server. This dev version contains no persistence or auth and can be used to quickly start a locally running Broker Server + Broker UI.",
"buildArgs": "-Pdmgmt-api-key"
},
{
"imageName": "broker-server-ce",
"title": "Broker Server (Community Edition)",
"description": "EDC IDS Broker Server. Contains DB extensions and requires dataspace credentials to join an existing dataspace.",
"buildArgs": "-Pdmgmt-api-key -Pfs-vault -Poauth2"
}
]
timeout-minutes: 30
permissions:
contents: read
packages: write
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: edc
POSTGRES_PASSWORD: edc
POSTGRES_DB: edc
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BASE }}/${{ matrix.imageVariants.imageName }}
labels: |
org.opencontainers.image.title=${{ matrix.imageVariants.title }}
org.opencontainers.image.description=${{ matrix.imageVariants.description }}
tags: |
type=schedule
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build and push EDC image
uses: docker/build-push-action@v4
with:
file: connector/Dockerfile
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
network: host
build-args: |
USERNAME=${{ github.actor }}
TOKEN=${{ secrets.GITHUB_TOKEN }}
BUILD_ARGS=${{ matrix.imageVariants.buildArgs }}
TEST_POSTGRES_JDBC_URL=jdbc:postgresql://localhost:5432/edc
TEST_POSTGRES_JDBC_USER=edc
TEST_POSTGRES_JDBC_PASSWORD=edc