-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathatmos-terraform-dispatch.yaml
More file actions
67 lines (60 loc) · 1.83 KB
/
atmos-terraform-dispatch.yaml
File metadata and controls
67 lines (60 loc) · 1.83 KB
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
64
65
66
name: 👽 Atmos Terraform Dispatch
run-name: 👽 Atmos Terraform Dispatch
on:
workflow_dispatch:
inputs:
component:
description: "Atmos Component"
type: string
stack:
description: "Atmos Stack"
type: string
plan:
description: "Terraform Plan"
type: boolean
default: true
apply:
description: "Terraform Apply"
type: boolean
default: false
distinct_id:
description: "Distinct ID"
permissions:
id-token: write
contents: read
jobs:
dispatch-id:
runs-on:
- "runs-on=${{ github.run_id }}"
- "runner=terraform"
- "tag=${{ inputs.component }}-${{ inputs.stack }}"
- "private=false"
steps:
- name: echo Distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}
atmos-plan:
needs: [ "dispatch-id" ]
if: ${{ inputs.plan }}
name: Plan (${{ inputs.stack }})
uses: ./.github/workflows/atmos-terraform-plan-matrix.yaml
with:
atmos-version: ${{ vars.ATMOS_VERSION }}
atmos-config-path: ${{ vars.ATMOS_CONFIG_PATH }}
stacks: |
{"include": [
{"component": "${{ inputs.component }}", "stack": "${{ inputs.stack }}", "stack_slug": "${{ inputs.stack }}-${{ inputs.component }}"}
]}
secrets: inherit
atmos-apply:
needs: ["atmos-plan"]
if: ${{ inputs.apply }}
name: Apply (${{ inputs.stack }})
uses: ./.github/workflows/atmos-terraform-apply-matrix.yaml
with:
atmos-version: ${{ vars.ATMOS_VERSION }}
atmos-config-path: ${{ vars.ATMOS_CONFIG_PATH }}
stacks: |
{"include": [
{"component": "${{ inputs.component }}", "stack": "${{ inputs.stack }}", "stack_slug": "${{ inputs.stack }}-${{ inputs.component }}"}
]}
secrets: inherit