Skip to content

chore: Data transfer objects added for controllers #16

chore: Data transfer objects added for controllers

chore: Data transfer objects added for controllers #16

name: CI Pipeline with Docker Compose
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
build-test-run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Docker and Docker Compose
uses: docker/setup-buildx-action@v2
- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: Set up environment file (.env)
run: |
echo "APPLICATION_PORT=8080" >> .env
echo "DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }}" >> .env
echo "DATABASE_URL=jdbc:postgresql://localhost:5432/auth" >> .env
echo "DATABASE_USERNAME=${{ secrets.DATABASE_USERNAME }}" >> .env
echo "EMAIL_SERVICE_NAME=NODEJS-MAIL-SERVICE" >> .env
echo "EUREKA_ENABLED=false" >> .env
- name: Start required services with Docker Compose
run: docker-compose up -d
- name: Wait for Database to Be Ready
run: sleep 10
- name: Build and Test the Application
run: |
mvn install -DskipTests
mvn test
- name: Run the Application
env:
APPLICATION_PORT: 8080
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_URL: jdbc:postgresql://localhost:5432/auth
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
run: mvn spring-boot:run &
- name: Verify Application is Running
run: sleep 10