Skip to content

Change image path in README #9

Change image path in README

Change image path in README #9

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: CI/CD - MasterChefAPI
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: πŸ“₯ Checkout del repositorio
uses: actions/checkout@v4
- name: β˜• Configurar Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'
- name: βš™οΈ Compilar y ejecutar pruebas
run: mvn clean verify
- name: πŸ“¦ Subir artefacto si es push a main
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: masterchef-api
path: target/*.jar
deploy:
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/main' # Solo se ejecuta en push a main
permissions:
id-token: write
contents: read
steps:
- name: πŸ“₯ Descargar artefacto generado
uses: actions/download-artifact@v4
with:
name: masterchef-api
- name: πŸ” Login a Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E3BBA8DC2C9849D1B0EFC1E10CE96DD0 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7C9E359957B94BC8950CA740807D8487 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A24240666636424A8BBF6C81D16FE73E }}
- name: πŸš€ Desplegar en Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: 'masterchefT2'
package: '*.jar'