Deploy SAP Workload Zone by @rdeveen #19
Workflow file for this run
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
# /*---------------------------------------------------------------------------8 | |
# | | | |
# | This workflows deploys the SAP Workload Zone with GitHub Actions | | |
# | | | |
# +------------------------------------4--------------------------------------*/ | |
name: Deploy SAP Workload Zone | |
run-name: Deploy SAP Workload Zone by @${{ github.actor }} | |
on: | |
workflow_dispatch: | |
inputs: | |
deployer: | |
description: "Deployer configuration name, use the following syntax: ENV-LOCA-VNET-INFRASTRUCTURE" | |
required: true | |
type: environment | |
workload_zone: | |
description: "Workload zone configuration name, use the following syntax: ENV-LOCA-VNET-INFRASTRUCTURE" | |
required: true | |
type: string | |
default: "DEV-WEEU-SAP01-INFRASTRUCTURE" | |
workload_environment: | |
description: "Workload environment (DEV, QA, PRD, ...)" | |
required: true | |
type: string | |
default: DEV | |
inherit_settings: | |
description: "Inherit Terraform state file information from control plane" | |
type: boolean | |
default: true | |
test: | |
description: "Test the deployment without actually deploying the resources" | |
type: boolean | |
default: false | |
permissions: | |
contents: write | |
id-token: write | |
issues: write | |
jobs: | |
deploy_sap_workload_zone: | |
name: Deploy SAP Workload Zone | |
environment: ${{ inputs.deployer }} | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/xpiritbv/azure-sap-automation:github-workflow | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get app token | |
id: get_workflow_token | |
uses: peter-murray/workflow-application-token-action@v3 | |
with: | |
application_id: ${{ secrets.APPLICATION_ID }} | |
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | |
organization: ${{ github.repository_owner }} | |
- name: Azure Login | |
uses: Azure/Login@v2 | |
with: | |
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}' | |
- name: Deploy SAP Workload Zone | |
run: | | |
cd ${SAP_AUTOMATION_REPO_PATH} | |
deploy/automation/02-deploy-sap-workload-zone/01-deploy-sap-workload-zone.sh | |
env: | |
APP_TOKEN: ${{ steps.get_workflow_token.outputs.token }} | |
CP_ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
CP_ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
CP_ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
CP_ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
#CP_ARM_OBJECT_ID: ${{ secrets.AZURE_OBJECT_ID }} | |
WL_ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
WL_ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
WL_ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
WL_ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
#WL_ARM_OBJECT_ID: ${{ secrets.AZURE_OBJECT_ID }} | |
SAP_AUTOMATION_REPO_PATH: ${{ github.workspace }} # TODO: Remove this line when using the scripts from the container | |
TEST_ONLY: ${{ inputs.test }} | |
deployerconfig: ${{ inputs.deployer }}.tfvars | |
deployerfolder: ${{ inputs.deployer }} | |
inherit: ${{ inputs.inherit_settings }} | |
workload_environment: ${{ inputs.workload_environment }} | |
workload_zone_folder: ${{ inputs.workload_zone }} | |
workload_zone_configuration_file: ${{ inputs.workload_zone }}.tfvars |