-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (55 loc) · 1.8 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy
on:
workflow_dispatch:
inputs: { }
push:
branches:
- main
env:
SPRING_APPS_SERVICE: ${{ secrets.SPRING_APPS_SERVICE }}
RESOURCE_GROUP: ${{ secrets.RESOURCE_GROUP }}
KEY_VAULT: ${{ secrets.KEY_VAULT }}
GUIDES_RENDERER_APP: guides-renderer
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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: .
- name: Set up Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_SPRING_IO }}
- name: Set up Azure Spring Extension
run: az extension add --name spring
- name: Create app
run: |
az spring app create \
--name ${GUIDES_RENDERER_APP} \
--resource-group "$RESOURCE_GROUP" \
--instance-count 2 \
--service "$SPRING_APPS_SERVICE"
continue-on-error: true
- name: Deploy
run: |
keyvault_uri=$(az keyvault show \
--resource-group ${RESOURCE_GROUP} \
--name ${KEY_VAULT} | jq -r '.properties.vaultUri')
az spring app deploy \
--name ${GUIDES_RENDERER_APP} \
--resource-group "$RESOURCE_GROUP" \
--build-env BP_JVM_VERSION=17 \
--service "$SPRING_APPS_SERVICE" \
--env "SPRING_CLOUD_AZURE_KEYVAULT_SECRET_PROPERTY_SOURCES_0_ENDPOINT=${keyvault_uri}" "SPRING_CLOUD_AZURE_KEYVAULT_SECRET_PROPERTY_SOURCES_0_NAME=${KEY_VAULT}"\
--source-path ./