Use GitHub Secret for AWS account id #4
This file contains 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: Deployment CI | |
on: | |
push: | |
branches: | |
- main | |
- test/** | |
pull_request: | |
jobs: | |
infrastructure: | |
name: infrastructure | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Setup Terraform CLI | |
uses: hashicorp/[email protected] | |
- name: Deploy infrastructure | |
if: | | |
github.ref == 'refs/heads/develop' || | |
startsWith(github.ref, 'refs/heads/test/') | |
run: | | |
cd ./deployment | |
echo "----- Running Terraform Init -----" | |
terraform init | |
echo "----- Running Terraform Plan -----" | |
terraform plan |