ci: ajout de la pipeline Gitea Actions et configuration de l'application dans docker-compose
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user