forked from spring-petclinic/spring-petclinic-microservices
-
Notifications
You must be signed in to change notification settings - Fork 196
128 lines (116 loc) · 4.67 KB
/
action.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Deploy to Azure Spring Apps using passwordless connections (build with maven)
on:
push:
branches:
- azure
pull_request:
branches:
- azure
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
# ==== APPS ====:
API_GATEWAY: api-gateway
ADMIN_SERVER: admin-server
CUSTOMERS_SERVICE: customers-service
VETS_SERVICE: vets-service
VISITS_SERVICE: visits-service
# ==== JARS ====:
API_GATEWAY_JAR: spring-petclinic-api-gateway/target/spring-petclinic-api-gateway-3.0.6.jar
ADMIN_SERVER_JAR: spring-petclinic-admin-server/target/spring-petclinic-admin-server-3.0.6.jar
CUSTOMERS_SERVICE_JAR: spring-petclinic-customers-service/target/spring-petclinic-customers-service-3.0.6.jar
VETS_SERVICE_JAR: spring-petclinic-vets-service/target/spring-petclinic-vets-service-3.0.6.jar
VISITS_SERVICE_JAR: spring-petclinic-visits-service/target/spring-petclinic-visits-service-3.0.6.jar
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Azure CLI Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Checkout your repo
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
cache: maven
- name: build with maven
run: |
mvn -B package -DskipTests
- name: Deploy api-gateway
uses: azure/spring-apps-deploy@v1
with:
azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
action: deploy
service-name: ${{ secrets.SPRING_APPS_SERVICE_NAME }}
app-name: ${{ env.API_GATEWAY }}
use-staging-deployment: false
package: ${{ github.workspace }}/${{ env.API_GATEWAY_JAR }}
jvm-options: -XX:InitialRAMPercentage=50.0 -XX:MinRAMPercentage=66.6 -XX:MaxRAMPercentage=66.6
# runtime-version: Java_17
cpu: 1
memory: 3Gi
environment-variables: -SPRING_PROFILES_ACTIVE passwordless BP_JVM_VERSION=17
- name: Deploy admin-server
uses: azure/spring-apps-deploy@v1
with:
azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
action: deploy
service-name: ${{ secrets.SPRING_APPS_SERVICE_NAME }}
app-name: ${{ env.ADMIN_SERVER }}
use-staging-deployment: false
package: ${{ github.workspace }}/${{ env.ADMIN_SERVER_JAR }}
jvm-options: -XX:InitialRAMPercentage=50.0 -XX:MinRAMPercentage=66.6 -XX:MaxRAMPercentage=66.6
# runtime-version: Java_17
cpu: 1
memory: 3Gi
environment-variables: -SPRING_PROFILES_ACTIVE passwordless BP_JVM_VERSION=17
- name: Deploy customers-service
uses: azure/spring-apps-deploy@v1
with:
azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
action: deploy
service-name: ${{ secrets.SPRING_APPS_SERVICE_NAME }}
app-name: ${{ env.CUSTOMERS_SERVICE }}
use-staging-deployment: false
package: ${{ github.workspace }}/${{ env.CUSTOMERS_SERVICE_JAR }}
jvm-options: -XX:InitialRAMPercentage=50.0 -XX:MinRAMPercentage=66.6 -XX:MaxRAMPercentage=66.6
# runtime-version: Java_17
cpu: 1
memory: 3Gi
environment-variables: -SPRING_PROFILES_ACTIVE passwordless BP_JVM_VERSION=17
- name: Deploy vets-service
uses: azure/spring-apps-deploy@v1
with:
azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
action: deploy
service-name: ${{ secrets.SPRING_APPS_SERVICE_NAME }}
app-name: ${{ env.VETS_SERVICE }}
use-staging-deployment: false
package: ${{ github.workspace }}/${{ env.VETS_SERVICE_JAR }}
jvm-options: -XX:InitialRAMPercentage=50.0 -XX:MinRAMPercentage=66.6 -XX:MaxRAMPercentage=66.6
# runtime-version: Java_17
cpu: 1
memory: 3Gi
environment-variables: -SPRING_PROFILES_ACTIVE passwordless BP_JVM_VERSION=17
- name: Deploy visits-service
uses: azure/spring-apps-deploy@v1
with:
azure-subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
action: deploy
service-name: ${{ secrets.SPRING_APPS_SERVICE_NAME }}
app-name: ${{ env.VISITS_SERVICE }}
use-staging-deployment: false
package: ${{ github.workspace }}/${{ env.VISITS_SERVICE_JAR }}
jvm-options: -XX:InitialRAMPercentage=50.0 -XX:MinRAMPercentage=66.6 -XX:MaxRAMPercentage=66.6
# runtime-version: Java_17
cpu: 1
memory: 3Gi
environment-variables: -SPRING_PROFILES_ACTIVE passwordless BP_JVM_VERSION=17