changed step to create mysql db #16
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: | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Start MySQL | |
uses: mysql/mysql-server-action@v2 | |
with: | |
mysql root password: password | |
mysql database: tfgdb | |
- 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 |