Skip to content

Add or update the Azure App Service build and deployment workflow config #2

Add or update the Azure App Service build and deployment workflow config

Add or update the Azure App Service build and deployment workflow config #2

Workflow file for this run

name: CD - Deploy to Azure App Service
on:
push:
branches:
- main
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B -DskipTests=true clean package
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: '<YOUR_AZURE_APP_NAME>' # reemplaza o deja en blanco si usas publish-profile
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: '${{ github.workspace }}/target/*.jar'