Secret validation #53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test AWS Connectivity | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| sandbox: | |
| name: "Plan & Deploy Sandbox Environment" | |
| runs-on: ubuntu-latest | |
| environment: Sandbox | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: "Validate Repository Secrets" | |
| run: | | |
| [[ "${{ vars.DEPLOY_ROLE_ARN }}" -eq "" ]] echo "::error title=Repository Configuration Incomplete::This repository is missing a secret for DEPLOY_ROLE_ARN!" | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v1.7.0 | |
| with: | |
| role-to-assume: ${{ vars.DEPLOY_ROLE_ARN }} | |
| role-session-name: ${{ github.repository }}|${{ github.event_name }}|${{github.ref}} | |
| 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 | |
| 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 | |
| with: | |
| tf_version: '1.5.5' | |
| tg_version: '0.54.11' | |
| tg_dir: 'platform/sandbox/us-east-2/000' | |
| tg_command: 'apply sandbox.tfplan' |