forked from spring-cloud-services-samples/acme-fitness-store
-
Notifications
You must be signed in to change notification settings - Fork 160
63 lines (59 loc) · 1.94 KB
/
order.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
name: Deploy Order
on:
workflow_dispatch:
inputs: { }
push:
branches:
- Azure
paths:
- 'apps/acme-order/**'
env:
SPRING_APPS_SERVICE: ${{ secrets.SPRING_APPS_SERVICE }}
RESOURCE_GROUP: ${{ secrets.RESOURCE_GROUP }}
KEY_VAULT: ${{ secrets.KEY_VAULT }}
CUSTOM_BUILDER: no-bindings-builder
ORDER_SERVICE_APP: order-service
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/acme-order
steps:
- uses: actions/checkout@v3
- name: Set up .NET Core SDK
uses: actions/setup-dotnet@v2
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Set up Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION }}
- name: Set up Azure Spring Extension
run: az extension add --name spring
- name: Deploy Order
run: |
keyvault_uri=$(az keyvault show \
--resource-group ${RESOURCE_GROUP} \
--name ${KEY_VAULT} \
--query properties.vaultUri -o tsv)
gateway_url=$(az spring gateway show \
--resource-group ${RESOURCE_GROUP} \
--service ${SPRING_APPS_SERVICE} \
--query properties.url -o tsv)
az spring app deploy \
--name ${ORDER_SERVICE_APP} \
--resource-group "$RESOURCE_GROUP" \
--service "$SPRING_APPS_SERVICE" \
--env "ConnectionStrings__KeyVaultUri=${keyvault_uri}" "AcmeServiceSettings__AuthUrl=https://${gateway_url}" "DatabaseProvider=Postgres" \
--builder ${CUSTOM_BUILDER} \
--source-path ./