Skip to content

Commit f2db15b

Browse files
committed
Probando CI CD
1 parent 4aad284 commit f2db15b

4 files changed

Lines changed: 24 additions & 113 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,24 @@
1-
name: CI - Maven Tests
1+
name: CI - Test Build
22

33
on:
44
push:
5-
branches:
6-
- develop
5+
branches: [develop]
76
pull_request:
8-
branches:
9-
- develop
10-
11-
permissions:
12-
contents: read
7+
branches: [develop]
138

149
jobs:
15-
build-and-test:
10+
build:
1611
runs-on: ubuntu-latest
12+
1713
steps:
18-
- name: Checkout repository
14+
- name: Checkout code
1915
uses: actions/checkout@v4
2016

2117
- name: Set up JDK 21
2218
uses: actions/setup-java@v4
2319
with:
24-
distribution: temurin
20+
distribution: 'temurin'
2521
java-version: '21'
2622

27-
- name: Cache Maven packages
28-
uses: actions/cache@v4
29-
with:
30-
path: ~/.m2/repository
31-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
32-
restore-keys: |
33-
${{ runner.os }}-maven-
34-
35-
- name: Build & run tests
36-
run: mvn -B -DskipTests=false clean test
37-
38-
- name: Upload test results (JUnit)
39-
if: always()
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: test-results
43-
path: target/surefire-reports
23+
- name: Build with Maven
24+
run: mvn clean package -DskipTests=false

.github/workflows/deploy.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
1-
name: CD - Deploy to Azure App Service
1+
name: Deploy to Azure Web App
22

33
on:
44
push:
55
branches:
66
- main
77

8-
permissions:
9-
contents: read
10-
packages: write
11-
128
jobs:
13-
build:
9+
build-and-deploy:
1410
runs-on: ubuntu-latest
11+
1512
steps:
1613
- name: Checkout code
1714
uses: actions/checkout@v4
1815

19-
- name: Set up JDK 21
16+
- name: Set up Java
2017
uses: actions/setup-java@v4
2118
with:
22-
distribution: temurin
19+
distribution: 'temurin'
2320
java-version: '21'
2421

25-
- name: Cache Maven packages
26-
uses: actions/cache@v4
27-
with:
28-
path: ~/.m2/repository
29-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30-
restore-keys: |
31-
${{ runner.os }}-maven-
32-
3322
- name: Build with Maven
34-
run: mvn -B -DskipTests=true clean package
23+
run: mvn clean package -DskipTests=true
3524

36-
- name: Deploy to Azure WebApp
37-
uses: azure/webapps-deploy@v2
25+
- name: 'Deploy to Azure WebApp'
26+
uses: azure/webapps-deploy@v3
3827
with:
39-
app-name: '<YOUR_AZURE_APP_NAME>' # reemplaza o deja en blanco si usas publish-profile
40-
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
41-
package: '${{ github.workspace }}/target/*.jar'
28+
app-name: masterchef
29+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISH_PROFILE }}
30+
package: target/*.jar

.github/workflows/main_masterchef.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/main/java/com/masterchef/recetas/controller/RecetaController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Probandooooo
3+
*/
4+
15
package com.masterchef.recetas.controller;
26

37
import com.masterchef.recetas.model.Receta;

0 commit comments

Comments
 (0)