Skip to content

Update azure-spring-apps.yml #7

Update azure-spring-apps.yml

Update azure-spring-apps.yml #7

name: Build and Deploy to Azure Spring Apps
on:
push:
branches:
- master
paths:
- tortolla/**
- .github/workflows/azure-spring-apps.yml
pull_request:
branches:
- master
paths:
- tortolla/**
- .github/workflows/azure-spring-apps.yml
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'
- name: Build with Maven
run: mvn -f tortolla/pom.xml clean package
- name: Login via Azure CLI
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_SP_CREDS }}
# - name: Deploy
# uses: Azure/spring-apps-deploy@v1
# with:
# azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION }}
# action: deploy
# service-name: tortolla-service
# app-name: tortolla
# use-staging-deployment: false
# deployment-name: default
# package: ${{ github.workspace }}/tortolla/presentation/target/*.jar
# cpu: 0.25
# memory: 512Mi
# runtime-version: 17
- name: Azure CLI Action to deploy
uses: Azure/cli@v2
with:
inlineScript: |
az spring app deploy \
--subscription ${{ secrets.AZURE_SUBSCRIPTION }}\
--resource-group tortolla\
--service tortolla-service\
--name tortolla\
--artifact-path ${{ github.workspace }}/tortolla/presentation/target/*.jar \
--runtime-version Java_17\
--build-cpu 0.25\
--build-memory 512Mi