Add B2C authentication #207
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: "Instance - plan prod" | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- 'terraform/instance/**' | |
jobs: | |
plan-terraform-prod: | |
environment: prod | |
env: | |
ARM_CLIENT_ID: ${{ secrets.TF_VAR_AGENT_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.TF_VAR_AGENT_CLIENT_SECRET }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.TF_VAR_SUBSCRIPTION_ID }} | |
ARM_TENANT_ID: ${{ secrets.TF_VAR_TENANT_ID }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: "./terraform" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v2 | |
- name: Terraform Format | |
id: fmt | |
run: terraform -chdir=instance fmt | |
- name: Terraform Init | |
id: init | |
run: terraform -chdir=instance init -backend-config="container_name=onlinestoretfstate-prod" | |
- name: Terraform Validate | |
id: validate | |
run: terraform -chdir=instance validate -no-color | |
- name: Terraform Plan | |
id: plan | |
run: terraform -chdir=instance plan -lock=false -no-color | |
env: | |
TF_VAR_location: "East US" | |
TF_VAR_environment: prod | |
TF_VAR_acr_username: ${{ secrets.ACR_USERNAME }} | |
TF_VAR_acr_password: ${{ secrets.ACR_TOKEN }} | |
TF_VAR_website_dns_subdomain: www | |
TF_VAR_api_dns_subdomain: api | |
TF_VAR_monitoring_dns_subdomain: monitoring | |
- name: Find Comment | |
uses: peter-evans/find-comment@v1 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: "### Terraform plan for prod" | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
edit-mode: replace | |
body: | | |
### Terraform plan for prod | |
#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` | |
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` | |
#### Terraform Validation 🤖${{ steps.validate.outputs.stdout }} | |
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\` | |
<details><summary>Show Plan</summary> | |
\`\`\`${process.env.PLAN}\`\`\` | |
</details> | |
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`* |