-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.8 KB
/
pipeline.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Rule Sets Pipeline
on:
pull_request:
branches:
- rule-sets-DTSPO-17918
push:
branches:
- rule-sets-DTSPO-17918
permissions:
id-token: write
contents: read
jobs:
precheck-sbox:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to Azure
run: |
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az account set --subscription ${{ secrets.DCD_CFT_SANDBOX_SUBSCRIPTION }}
- name: Use Terraform
uses: hashicorp/setup-terraform@v1
- name: Change directory to Terraform config
run: cd components
- name: Precheck Terraform
working-directory: components
env:
AZURE_SUBSCRIPTION_ID: ${{ secrets.DCD_CFT_SANDBOX_SUBSCRIPTION }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
terraform init \
-backend-config="subscription_id=${{ secrets.DCD_CFT_SANDBOX_SUBSCRIPTION }}"
terraform plan \
-var="location=UK South" \
-var="override_action=plan" \
-var="github_token=${{ secrets.PAT_TOKEN }}"
- name: Plan Terraform
working-directory: components
env:
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.DCD_CFT_SANDBOX_SUBSCRIPTION }}
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
terraform plan \
-var="location=UK South" \
-var="override_action=plan" \
-var="github_token=${{ secrets.PAT_TOKEN }}"