Emergency fix: Fix admin authorization (#429) #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Infra apply test | |
on: | |
workflow_dispatch: | |
inputs: | |
initialDeploy: | |
type: boolean | |
description: Initial deploy | |
default: false | |
push: | |
branches: [main] | |
paths-ignore: | |
- "Test/**" # ignore changes to tests | |
env: | |
name: broker | |
deployment_environment: test | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
id-token: write | |
jobs: | |
generate-git-short-sha: | |
name: Generate git short sha | |
uses: ./.github/workflows/action-generate-git-short-sha.yml | |
get-current-version: | |
name: Get current version | |
uses: ./.github/workflows/action-get-current-version.yml | |
check-for-changes: | |
name: Check for changes | |
uses: ./.github/workflows/action-check-for-changes.yml | |
test: | |
name: Test application | |
uses: ./.github/workflows/action-test-application.yml | |
needs: [check-for-changes] | |
if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} | |
publish: | |
name: Build and publish docker images | |
uses: ./.github/workflows/action-build-and-push.yml | |
needs: [get-current-version, generate-git-short-sha, check-for-changes, test] | |
if: ${{ inputs.initialDeploy || needs.check-for-changes.outputs.hasBackendChanges == 'true' }} | |
with: | |
dockerImageBaseName: ghcr.io/altinn/altinn-broker | |
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }} | |
deploy-infra: | |
name: Deploy infrastructure | |
if: ${{ inputs.initialDeploy || needs.check-for-changes.outputs.hasAzureChanges == 'true' }} | |
needs: [check-for-changes, get-current-version, test] | |
uses: ./.github/workflows/action-deploy-infra.yml | |
secrets: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_OIDC_TEST_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_OIDC_TEST_TENANT_ID }} | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_OIDC_TEST_SUBSCRIPTION_ID }} | |
AZURE_OBJECT_ID: ${{ secrets.AZURE_TEST_PRINCIPAL_ID}} | |
AZURE_TEST_ACCESS_CLIENT_ID : ${{ secrets.AZURE_TEST_ACCESS_CLIENT_ID }} | |
AZURE_NAME_PREFIX: ${{ secrets.AZURE_TEST_NAME_PREFIX }} | |
AZURE_SOURCE_KEY_VAULT_NAME: ${{ secrets.AZURE_SOURCE_TEST_KEY_VAULT_NAME }} | |
AZURE_MIGRATION_STORAGE_ACCOUNT_NAME: ${{ secrets.AZURE_TEST_MIGRATION_STORAGE_ACCOUNT_NAME }} | |
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_TEST_CLIENT_SECRET }} | |
MASKINPORTEN_JWK: ${{ secrets.MASKINPORTEN_JWK }} | |
MASKINPORTEN_CLIENT_ID: ${{ secrets.MASKINPORTEN_CLIENT_ID }} | |
PLATFORM_SUBSCRIPTION_KEY: ${{ secrets.PLATFORM_SUBSCRIPTION_KEY }} | |
with: | |
region: norwayeast | |
environment: test | |
version: ${{ needs.get-current-version.outputs.version }} | |
ref: ${{ github.ref }} | |
deploy-app: | |
name: Deploy app to test | |
needs: | |
[ | |
get-current-version, | |
check-for-changes, | |
generate-git-short-sha, | |
publish, | |
deploy-infra, # we want deployment of app to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the app | |
test | |
] | |
if: ${{ (inputs.initialDeploy || needs.check-for-changes.outputs.hasBackendChanges == 'true') && always() && !failure() && !cancelled() }} | |
uses: ./.github/workflows/action-deploy-app.yml | |
secrets: | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_OIDC_TEST_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_OIDC_TEST_TENANT_ID }} | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_OIDC_TEST_SUBSCRIPTION_ID }} | |
AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_SOURCE_TEST_KEY_VAULT_NAME }} | |
AZURE_NAME_PREFIX: ${{ secrets.AZURE_TEST_NAME_PREFIX }} | |
AZURE_MIGRATION_STORAGE_ACCOUNT_NAME: ${{ secrets.AZURE_TEST_MIGRATION_STORAGE_ACCOUNT_NAME }} | |
with: | |
environment: test | |
region: norwayeast | |
ref: ${{ github.ref }} | |
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }} | |
migrate: ${{ needs.check-for-changes.outputs.hasMigrationChanges == 'true' || github.event.inputs.initialDeploy }} |