ci: ajout de la pipeline Gitea Actions et configuration de l'application dans docker-compose
AS Talange CI/CD Pipeline / Build & Run in Docker Container (push) Has been cancelled
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Has been cancelled

This commit is contained in:
2026-05-30 23:24:32 +02:00
parent 8a15139efb
commit 7743a220ef
2 changed files with 55 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
name: AS Talange CI/CD Pipeline
on:
push:
branches:
- main
jobs:
test:
name: Build & Run Unit Tests
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Run Maven Tests
run: mvn clean test
deploy:
name: Build & Run in Docker Container
needs: test
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy with Docker Compose
run: |
echo "Building and restarting the application container..."
docker compose down app || true
docker compose up -d --build app
echo "Application is running at http://localhost:8080"
+16
View File
@@ -23,5 +23,21 @@ services:
depends_on: depends_on:
- db - db
app:
build:
context: .
dockerfile: Dockerfile
container_name: astalange_app
ports:
- "8080:8080"
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/astalange
- SPRING_DATASOURCE_USERNAME=myuser
- SPRING_DATASOURCE_PASSWORD=mypassword
depends_on:
- db
restart: always
volumes: volumes:
postgres_data: postgres_data: