Deploy Payment #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Payment | |
on: | |
workflow_dispatch: | |
inputs: { } | |
push: | |
branches: | |
- Azure | |
paths: | |
- 'apps/acme-payment/**' | |
env: | |
SPRING_APPS_SERVICE: ${{ secrets.SUBSCRIPTION }} | |
RESOURCE_GROUP: ${{ secrets.RESOURCE_GROUP }} | |
PAYMENT_SERVICE_APP: payment-service | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: apps/acme-payment | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Az CLI login' | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.SUBSCRIPTION }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build | |
build-root-directory: apps/acme-payment | |
- name: Set up Azure Spring Extension | |
run: az extension add --name spring | |
- name: Deploy Payment | |
run: | | |
az spring app deploy \ | |
--name ${PAYMENT_SERVICE_APP} \ | |
--resource-group "$RESOURCE_GROUP" \ | |
--service "$SPRING_APPS_SERVICE" \ | |
--config-file-pattern payment/default \ | |
--build-env BP_JVM_VERSION=17 \ | |
--source-path ./ |