Skip to content

Commit d53695c

Browse files
Stages within a single job
1 parent 8a48a58 commit d53695c

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
plan:
13+
Sandbox:
1414
runs-on: ubuntu-latest
1515
environment: Sandbox
1616
steps:
@@ -25,6 +25,7 @@ jobs:
2525
aws-region: ${{ vars.AWS_REGION }}
2626

2727
- name: Plan
28+
id: plan
2829
uses: gruntwork-io/terragrunt-action@v2
2930
env:
3031
AWS_REGION: ${{ vars.AWS_REGION }}
@@ -33,37 +34,25 @@ jobs:
3334
INPUT_POST_EXEC_0: |
3435
pwd
3536
ls -al /github/workspace/
36-
find / -name "test.tfplan"
37+
tfplan_location=$(find . -name "sandbox.tfplan")
38+
echo "TERRAFORM_PLAN=$(cat $tfplan_location)" >> "$GITHUB_OUTPUT"
3739
with:
3840
tf_version: '1.5.5'
3941
tg_version: '0.54.11'
4042
tg_dir: 'platform/sandbox/us-east-2/000'
41-
tg_command: 'plan -out test.tfplan'
42-
deploy:
43-
runs-on: ubuntu-latest
44-
needs: [ plan ]
45-
environment: Sandbox
46-
steps:
47-
- name: Checkout
48-
uses: actions/checkout@main
49-
50-
- name: Configure AWS credentials
51-
uses: aws-actions/configure-aws-credentials@v1.7.0
52-
with:
53-
role-to-assume: ${{ vars.DEPLOY_ROLE_ARN }}
54-
role-session-name: Test-AWS-GHA-OIDC
55-
aws-region: ${{ vars.AWS_REGION }}
56-
57-
- uses: actions/setup-python@v5
58-
with:
59-
python-version: '3.13'
43+
tg_command: 'plan -out sandbox.tfplan'
6044

6145
- name: Deploy
6246
uses: gruntwork-io/terragrunt-action@v2
6347
env:
6448
AWS_REGION: ${{ vars.AWS_REGION }}
65-
INPUT_PRE_EXEC_1: |
49+
TERRAFORM_PLAN: ${{ steps.plan.outputs.TERRAFORM_PLAN }}
50+
INPUT_PRE_EXEC_0: |
6651
sudo apt update -yqq && sudo apt install python3 -yqq
52+
INPUT_PRE_EXEC_1: |
53+
echo $TERRAFORM_PLAN >> platform/sandbox/us-east-2/000/sandbox.tfplan
54+
INPUT_PRE_EXEC_2: |
55+
cat platform/sandbox/us-east-2/000/sandbox.tfplan
6756
with:
6857
tf_version: '1.5.5'
6958
tg_version: '0.54.11'

0 commit comments

Comments
 (0)