Skip to content

Merge pull request #3 from daniel-pm19/develop #20

Merge pull request #3 from daniel-pm19/develop

Merge pull request #3 from daniel-pm19/develop #20

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy

Check failure on line 1 in .github/workflows/develop_mastercheft2.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/develop_mastercheft2.yml

Invalid workflow file

(Line: 42, Col: 1): Unexpected value '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
permissions:
id-token: write
contents: read
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: java-app
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E3BBA8DC2C9849D1B0EFC1E10CE96DD0 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A24240666636424A8BBF6C81D16FE73E }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7C9E359957B94BC8950CA740807D8487 }}
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'theboys-sirha'
slot-name: 'Production'
package: '*.jar'