Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-XXX] Resolve B2C deploy issues #45

Merged
merged 4 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions .github/workflows/b2c-build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:
required: false
type: string
description: "AKS Key vault."
azureB2CProductShortName:
required: true
type: string
description: "Short name of the B2C product."
azureB2CDomain:
required: true
type: string
Expand All @@ -27,10 +23,6 @@ on:
required: true
type: string
description: "ID of the B2C product."
azureB2CProductName:
required: true
type: string
description: "Name of the B2C product."
secrets:
azureCredentials:
required: true
Expand Down Expand Up @@ -101,30 +93,27 @@ jobs:
environmentKeyVault: ${{ inputs.environmentKeyVault }}

- name: Get Fresh Packages
shell: pwsh
run: |
yarn install

- name: Build Policies
shell: pwsh
run: |
yarn build:${{ inputs.environment }}
yarn generate

- name: Upload TrustFrameworkBase Policy
uses: Andrews-McMeel-Universal/deploy-trustframework-policy@v5
uses: azure-ad-b2c/deploy-trustframework-policy@v5.3
with:
folder: "./dist/${{ inputs.azureB2CProductName }}/custom-policies"
folder: "./dist/custom-policies"
files: "B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_BASE.xml,B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_EXTENSIONS.xml,B2C_1A_${{ inputs.azureB2CProductId }}_SIGNINSIGNOUT_POLICIES.xml,B2C_1A_${{ inputs.azureB2CProductId }}_IMPERSONATION.xml"
tenant: ${{ inputs.azureB2CDomain }}
clientId: ${{ secrets.azureB2CClientId }}
clientSecret: ${{ secrets.azureB2CClientSecret }}
verbose: ${{ secrets.ACTIONS_STEP_DEBUG || env.ACTIONS_STEP_DEBUG || 'false' }}
verbose: ${{ secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG || env.ACTIONS_STEP_DEBUG || 'false' }}

- name: Upload Auth Assets
uses: azure/powershell@v1
with:
inlineScript: |
$BasePath = Get-Location
$DistPath = Join-Path $BasePath "dist"
./deployments/scripts/Deploy-B2C_Auth.ps1 -StorageAccountName "amuauthassets" -StorageAccountKey "${{ secrets.storageAccountKey }}" -ContainerName "${{ inputs.environment }}-assets" -DistPath $DistPath -ProductPath "${{ inputs.azureB2CProductShortName }}"
$DistPath = Join-Path (Get-Location) "dist"
./deployments/scripts/Deploy-B2C-Auth.ps1 -StorageAccountName "amuauthassets" -StorageAccountKey "${{ secrets.storageAccountKey }}" -ContainerName "${{ inputs.environment }}-assets" -DistPath $DistPath
azPSVersion: "latest"
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,20 @@ jobs:

```YAML Example
jobs:
b2c-build-and-deploy:
deploy:
name: B2C Deploy
uses: Andrews-McMeel-Universal/reusable_workflows/.github/workflows/b2c-build-and-deploy.yaml@2
with:
environment: development
azureB2CProductName: appname
environmentKeyVault: ${{ vars.AZURE_KEYVAULT_PREFIX }}-development
azureB2CDomain: developmentamub2c.onmicrosoft.com
azureB2CProductURL: development.appname.com
azureB2CProductId: APPID
secrets:
azureCredentials: ${{ secrets.AZURE_CREDENTIALS }}
storageAccountKey: ${{ secrets.STORAGEACCOUNT_KEY }}
azureB2CClientId: ${{ secrets.B2C_CLIENT_ID }}
azureB2CClientSecret: ${{ secrets.B2C_CLIENT_SECRET }}
storageAccountKey: ${{ secrets.AZURE_B2C_STORAGE_ACCOUNT_KEY }}
azureB2CClientId: ${{ secrets.AZURE_B2C_CLIENT_ID }}
azureB2CClientSecret: ${{ secrets.AZURE_B2C_CLIENT_SECRET }}
```

### Purge CDN
Expand Down