Add time added to frontend #44
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 | |
services: | |
mysql: | |
image: mysql:8.0.31 | |
env: | |
MYSQL_ROOT_PASSWORD: 12345678 | |
MYSQL_DATABASE: tfgdb | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
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 | |
env: | |
DB_DATABASE: tfgdb | |
DB_USER: root | |
DB_PASSWORD: 12345678 | |
DB_HOST: ${{ env.MYSQL_IP }} | |
run: | | |
cd ./Backend | |
mvn clean install -DskipTests | |
mvn test -Dspring.profiles.active=test | |
- name: Show MySQL logs | |
if: failure() | |
run: | | |
docker logs ${{ job.services.mysql.id }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Create Firebase service account file | |
run: | | |
echo "${{ secrets.FIREBASE_SERVICEACCOUNT }}" > ./Docker/App/firebase-service-account.json | |
- name: Build and push Docker image for Backend | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Docker/App/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: jesussmariscal/reurjc:latest |