Skip to content

Stages within a single job #40

Stages within a single job

Stages within a single job #40

Workflow file for this run

name: Test AWS Connectivity
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
permissions:
id-token: write
contents: read
jobs:
Sandbox:
runs-on: ubuntu-latest
environment: Sandbox
steps:
- name: Checkout
uses: actions/checkout@main
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
role-to-assume: ${{ vars.DEPLOY_ROLE_ARN }}
role-session-name: Test-AWS-GHA-OIDC
aws-region: ${{ vars.AWS_REGION }}
- name: Plan
id: plan
uses: gruntwork-io/terragrunt-action@v2
env:
AWS_REGION: ${{ vars.AWS_REGION }}
INPUT_PRE_EXEC_0: |
sudo apt update -yqq && sudo apt install python3 -yqq
INPUT_POST_EXEC_0: |
pwd
ls -al /github/workspace/
echo "find?"
find . -name "sandbox.tfplan"
echo "found!"
tfplan_location=$(find . -name "sandbox.tfplan")
echo "TERRAFORM_PLAN=$(cat $tfplan_location)" >> "$GITHUB_OUTPUT"
with:
tf_version: '1.5.5'
tg_version: '0.54.11'
tg_dir: 'platform/sandbox/us-east-2/000'
tg_command: 'plan -out sandbox.tfplan'
- name: Deploy
uses: gruntwork-io/terragrunt-action@v2
env:
AWS_REGION: ${{ vars.AWS_REGION }}
TERRAFORM_PLAN: ${{ steps.plan.outputs.TERRAFORM_PLAN }}
INPUT_PRE_EXEC_0: |
sudo apt update -yqq && sudo apt install python3 -yqq
INPUT_PRE_EXEC_1: |
echo $TERRAFORM_PLAN >> platform/sandbox/us-east-2/000/sandbox.tfplan
INPUT_PRE_EXEC_2: |
cat platform/sandbox/us-east-2/000/sandbox.tfplan
with:
tf_version: '1.5.5'
tg_version: '0.54.11'
tg_dir: 'platform/sandbox/us-east-2/000'
tg_command: 'apply'