ci and bug fixed #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Backend | |
on: | |
push: # Se ejecuta en cada push a cualquier rama | |
workflow_dispatch: # Permite ejecutar el workflow manualmente | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build and Test with Maven | |
run: | | |
cd ./Backend | |
mvn clean install -DskipTests | |
mvn test -Dspring.profiles.active=test | |
- name: Dockerize application | |
run: | | |
docker build -t jesussmariscal/reurjc -f ./Docker/App/Dockerfile . | |
cd ./Docker/App | |
docker-compose -p myurjc up -d | |
- name: Stop Docker Compose | |
if: always() | |
run: | | |
cd ./Docker/App | |
docker-compose -p myurjc down |