Skip to content

Commit

Permalink
Rename the cd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
settiy-ms committed Nov 16, 2023
1 parent 330bf29 commit 0710f5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 96 deletions.
84 changes: 0 additions & 84 deletions .github/workflows/cd-workload-identity.yml

This file was deleted.

27 changes: 15 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: "Test samples in mCCF environment"
name: "deploy-test-app-samples-to-mccf"

on:
push:
branches: [main]
workflow_dispatch:

permissions:
id-token: write

jobs:
deploy:
name: Managed CCF
Expand All @@ -13,7 +16,7 @@ jobs:
env:
ccfName: ccf-app-samples-test-${{ github.run_number }}
rgName: ccf-app-samples-test-${{ github.run_number }}-rg
ResourceGroupLocation: "westeurope"
ResourceGroupLocation: "southcentralus"
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -24,7 +27,9 @@ jobs:
- name: Azure Login
uses: Azure/login@v1.4.5
with:
creds: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}","clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.ARM_TENANT_ID }}"}' # editorconfig-checker-disable-line
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
Expand All @@ -38,24 +43,22 @@ jobs:
with:
inlineScript: |
#!/bin/bash
az group create --name ${{ env.ccfName }}-rg --location ${{ env.ResourceGroupLocation }}
az group create --name ${{ env.rgName }} --location ${{ env.ResourceGroupLocation }}
- name: Deploy Managed CCF Network
uses: azure/arm-deploy@v1
with:
resourceGroupName: ${{ env.ccfName }}
resourceGroupName: ${{ env.rgName }}
template: ./deploy/arm/mccf.json
parameters: ./deploy/arm/parameters.json mccfMemberBasedSecurityPrincipals="[{\"cert\":\"${{ secrets.PUBLIC_CERT }}\", \"encryptionKey\":\"\"}]" resourceName="${{ env.ccfName }}"
parameters: ./deploy/arm/parameters.json mccfMemberBasedSecurityPrincipals="[{\"cert\":\"${{ secrets.ARM_TEMPLATE_PUBLIC_CERT }}\", \"encryptionKey\":\"\"}]" resourceName="${{ env.ccfName }}"

- name: Deploy Banking Sample to mCCF
uses: devcontainers/ci@v0.2
with:
imageName: ghcr.io/microsoft/ccf-samples-devcontainer
cacheFrom: ghcr.io/microsoft/ccf-samples-devcontainer
eventFilterForPush: push
refFilterForPush: refs/heads/main
runCmd: |
cd banking-app && make test-mccf
cd banking-app && make test-mccf-cd
env: |
PUBLIC_CERT=${{ secrets.PUBLIC_CERT }}
PRIVATE_CERT=${{ secrets.PRIVATE_CERT }}
Expand All @@ -66,7 +69,7 @@ jobs:
with:
imageName: ghcr.io/microsoft/ccf-samples-devcontainer
runCmd: |
cd data-reconciliation-app && make test-mccf
cd data-reconciliation-app && make test-mccf-cd
env: |
PUBLIC_CERT=${{ secrets.PUBLIC_CERT }}
PRIVATE_CERT=${{ secrets.PRIVATE_CERT }}
Expand All @@ -78,5 +81,5 @@ jobs:
with:
inlineScript: |
#!/bin/bash
echo "Always delete resource group because of quota"
az group delete --name ${{ env.ccfName }} --yes --no-wait
echo "Always delete resource group because of quota limit"
az group delete --name ${{ env.rgName }} --yes --no-wait

0 comments on commit 0710f5a

Please sign in to comment.