-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.4 KB
/
terraformPlan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Ad-hoc Terraform Plan
on:
workflow_dispatch:
inputs:
env:
description: "Environment target"
required: true
default: "prod"
jobs:
terraform-plan:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ops
env: # all Azure interaction is through Terraform
ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Use prod Okta token if required
if: ${{ github.event.inputs.env == 'prod' || github.event.inputs.env == 'stg' }}
run: |
echo "OKTA_API_TOKEN=${{ secrets.OKTA_API_TOKEN }}" >> "$GITHUB_ENV"
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.1.4
- name: Terraform Init
run: make init-${{ github.event.inputs.env }}
- name: Build ReportStream function app
uses: ./.github/actions/build-reportstream-functions
with:
deploy-env: ${{env.DEPLOY_ENV}}
- name: Terraform plan
run: make plan-${{ github.event.inputs.env }}