-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.92 KB
/
deploy-test.yml
File metadata and controls
61 lines (54 loc) · 1.92 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
name: "Deploy - Test"
run-name: "${{ inputs.git_ref }}"
on:
workflow_dispatch:
inputs:
git_ref:
description: "Branch, tag or SHA to deploy"
required: true
type: "string"
permissions:
pull-requests: write
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
terraform_plan_apply_base_iam:
name: Terraform Plan/Apply (base_iam)
runs-on: ubuntu-latest
environment: test
steps:
- name: Checkout branch
uses: actions/checkout@v6
with:
ref: ${{ inputs.git_ref }}
- name: Apply base_iam
uses: ./.github/actions/tf-plan-apply
with:
aws_assume_role: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/test-github-bootstrap
bucket_prefix: "test"
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_region: ${{ vars.AWS_REGION }}
working_directory: "./base_iam" # Use separate base_iam directory
workspace: ${{ secrets.AWS_WORKSPACE }}
tf_vars_file: ${{ vars.TF_VARS_FILE }}
tf_extra_args: "-var aws_account_id=${{ secrets.AWS_ACCOUNT_ID }}"
terraform_plan_apply:
name: Terraform Plan/Apply (ndr-test)
runs-on: ubuntu-latest
needs: terraform_plan_apply_base_iam
environment: test
steps:
- name: Checkout main
uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.git_ref }}
- name: Apply Main
uses: ./.github/actions/tf-plan-apply
with:
# use newly created role
aws_assume_role: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_WORKSPACE }}-github-actions-role
bucket_prefix: "test"
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
aws_region: ${{ vars.AWS_REGION }}
workspace: ${{ secrets.AWS_WORKSPACE }}
tf_vars_file: ${{ vars.TF_VARS_FILE }}