Skip to content

refactor: separate frontend and backend into independent containers #114

refactor: separate frontend and backend into independent containers

refactor: separate frontend and backend into independent containers #114

Workflow file for this run

name: Maven CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
# Required for the `timescaledb` extension used by Flyway migrations.
image: timescale/timescaledb:2.25.0-pg15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: eventara
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
zookeeper:
image: confluentinc/cp-zookeeper:7.4.0
ports:
- 2181:2181
env:
ZOOKEEPER_CLIENT_PORT: 2181
kafka:
image: confluentinc/cp-kafka:7.4.0
ports:
- 9093:9093
env:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
options: >-
--health-cmd "bash -c '</dev/tcp/localhost/9093'"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Wait for services
run: |
echo "Waiting for PostgreSQL..."
for i in {1..20}; do
nc -z localhost 5432 && break
sleep 3
done
echo "Waiting for Kafka..."
for i in {1..20}; do
nc -z localhost 9093 && break
sleep 3
done
- name: Build & test
run: mvn -B clean verify
- name: Package JAR
run: mvn -B package -DskipTests
- name: Upload built JAR
uses: actions/upload-artifact@v4
with:
name: eventara-ingestion-service
path: target/*.jar