-
Notifications
You must be signed in to change notification settings - Fork 29
85 lines (75 loc) · 2.73 KB
/
cd.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
name: "deploy-test-app-samples-to-mccf"
on:
push:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
jobs:
deploy:
name: Managed CCF
runs-on: ubuntu-20.04
environment: dev
env:
ccfName: ccf-app-samples-test-${{ github.run_number }}
rgName: ccf-app-samples-test-${{ github.run_number }}-rg
ResourceGroupLocation: "southcentralus"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Azure Login
uses: Azure/[email protected]
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Login to GH-CR to push the updated devcontainer image
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create Resource Group
uses: Azure/CLI@v1
with:
inlineScript: |
#!/bin/bash
az group create --name ${{ env.rgName }} --location ${{ env.ResourceGroupLocation }}
- name: Deploy Managed CCF Network
uses: azure/arm-deploy@v1
with:
resourceGroupName: ${{ env.rgName }}
template: ./deploy/arm/mccf.json
parameters: ./deploy/arm/parameters.json mccfMemberBasedSecurityPrincipals="[{\"cert\":\"${{ secrets.ARM_TEMPLATE_PUBLIC_CERT }}\", \"encryptionKey\":\"\"}]" resourceName="${{ env.ccfName }}"
- name: Deploy Banking Sample to mCCF
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/microsoft/ccf-samples-devcontainer
cacheFrom: ghcr.io/microsoft/ccf-samples-devcontainer
runCmd: |
cd banking-app && make test-mccf-cd
env: |
PUBLIC_CERT=${{ secrets.PUBLIC_CERT }}
PRIVATE_CERT=${{ secrets.PRIVATE_CERT }}
CCF_NAME=${{ env.ccfName }}
- name: Deploy Data Reconciliation Sample to mCCF
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/microsoft/ccf-samples-devcontainer
runCmd: |
cd data-reconciliation-app && make test-mccf-cd
env: |
PUBLIC_CERT=${{ secrets.PUBLIC_CERT }}
PRIVATE_CERT=${{ secrets.PRIVATE_CERT }}
CCF_NAME=${{ env.ccfName }}
- name: Delete Resource Group
uses: Azure/CLI@v1
if: always()
with:
inlineScript: |
#!/bin/bash
echo "Always delete resource group because of quota limit"
az group delete --name ${{ env.rgName }} --yes --no-wait