-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
63 lines (63 loc) · 2.14 KB
/
action.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: 'CAF landing zone '
description: 'VolkerWessels purge landing zones'
inputs:
purge:
description: '"USE WITH CAUTION" If terraform destroy fails a destroy can be forced using azure CLI'
default: "false"
required: false
branch:
description: 'The branch of the caf-terraform-landingzones repository'
default: 2108.0-modified
required: false
config_dir:
description: 'A directory in `github.workspace` containing config (*.tfvar) files.'
required: true
environment:
description: 'The environment variable used in Azure tags'
required: true
prefix:
description: 'The prefix variable used in Azure naming'
required: true
landingzone:
description: 'the segment (launchpad, solution or add-on) of a cloud environment to deploy'
required: true
level:
description: 'Deploy level'
required: true
runs:
using: "composite"
steps:
- run: |
echo "GITHUB_ACTION_PATH=${GITHUB_ACTION_PATH}" >> $GITHUB_ENV;
echo "TFVARS_PATH=${{ inputs.config_dir }}" >> $GITHUB_ENV;
echo "BASE_PATH=$(dirname ${{ inputs.config_dir }})" >> $GITHUB_ENV;
shell: bash
- name: Terraform Cache
id: terraform-cache
uses: actions/cache@v2
with:
path: |
${TF_PLUGIN_CACHE_DIR}
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
restore-keys: |
${{ runner.os }}-terraform-
- name: Install landingzones
run: make landingzones
shell: bash
working-directory: ${{ env.GITHUB_ACTION_PATH }}
env:
TF_LZ_GIT: https://github.com/VolkerWessels/caf-terraform-landingzones.git
TF_LZ_BRANCH: ${{ inputs.branch }}
- name: Azure login with service principal
run: make login
working-directory: ${{ env.GITHUB_ACTION_PATH }}
shell: bash
- name: Run destroy
id: solution-destroy
run: make destroy SOLUTION=${{ inputs.landingzone }} LEVEL=${{ inputs.level }}
working-directory: ${{ env.GITHUB_ACTION_PATH }}
env:
PURGE: ${{ inputs.purge }}
PREFIX: ${{ inputs.prefix }}
ENVIRONMENT: ${{ inputs.environment }}
shell: bash