Deploy Metastore and Permanent Resources #13
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
name: "Deploy Metastore and Permanent Resources" | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: | |
# - main | |
# paths: | |
# - ".github/terraform/metastore/**" | |
# - ".github/terraform/permanent_resources/**" | |
# - ".github/workflows/deployment-permanent-resources.yml" | |
jobs: | |
deploy_permanent_resources: | |
environment: "azure" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to azure | |
shell: pwsh | |
run: | | |
az login --service-principal ` | |
-u ${{ secrets.SPN_CLIENT_ID }} ` | |
-p ${{ secrets.SPN_CLIENT_SECRET }} ` | |
--tenant ${{ secrets.SPN_TENANT_ID }} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_wrapper: false | |
- name: Databricks Metastore Terraform Init | |
run: terraform -chdir="./.github/terraform/metastore" init | |
env: | |
ARM_ACCESS_KEY: ${{ secrets.BACKEND_STORAGE_ACCESS_KEY }} | |
ARM_CLIENT_ID: ${{ secrets.SPN_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.SPN_CLIENT_SECRET }} | |
ARM_TENANT_ID: ${{ secrets.SPN_TENANT_ID }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.SPN_SUBSCRIPTION_ID }} | |
TF_VAR_db_account_id: ${{ secrets.DATABRICKS_ACCOUNT_ID }} | |
- name: Databricks Metastore Terraform Apply | |
run: terraform -chdir="./.github/terraform/metastore" apply -auto-approve | |
env: | |
ARM_ACCESS_KEY: ${{ secrets.BACKEND_STORAGE_ACCESS_KEY }} | |
ARM_CLIENT_ID: ${{ secrets.SPN_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.SPN_CLIENT_SECRET }} | |
ARM_TENANT_ID: ${{ secrets.SPN_TENANT_ID }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.SPN_SUBSCRIPTION_ID }} | |
TF_VAR_db_account_id: ${{ secrets.DATABRICKS_ACCOUNT_ID }} | |
- name: Permanent Resources Terraform Init | |
run: terraform -chdir="./.github/terraform/permanent_resources" init | |
env: | |
ARM_ACCESS_KEY: ${{ secrets.BACKEND_STORAGE_ACCESS_KEY }} | |
ARM_CLIENT_ID: ${{ secrets.SPN_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.SPN_CLIENT_SECRET }} | |
ARM_TENANT_ID: ${{ secrets.SPN_TENANT_ID }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.SPN_SUBSCRIPTION_ID }} | |
TF_VAR_db_account_id: ${{ secrets.DATABRICKS_ACCOUNT_ID }} | |
- name: Permanent Resources Terraform Apply | |
run: terraform -chdir="./.github/terraform/permanent_resources" apply -auto-approve | |
env: | |
ARM_ACCESS_KEY: ${{ secrets.BACKEND_STORAGE_ACCESS_KEY }} | |
ARM_CLIENT_ID: ${{ secrets.SPN_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.SPN_CLIENT_SECRET }} | |
ARM_TENANT_ID: ${{ secrets.SPN_TENANT_ID }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.SPN_SUBSCRIPTION_ID }} | |
TF_VAR_db_account_id: ${{ secrets.DATABRICKS_ACCOUNT_ID }} | |
- name: Azure logout | |
shell: pwsh | |
run: az logout |