adding checkout for repository inside the runner #3
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: Terraform Deploy | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'infra/**' | |
- .github/workflows/terraform.yaml | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
AWS_REGION: sa-east-1 | |
steps: | |
- name: configure aws credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: ${{ env.AWS_REGION }} | |
- name: install terraform | |
uses: hashicorp/setup-terraform@v2 | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: changing directory | |
run: cd infra/ | |
- name: terraform init | |
run: terraform init | |
- name: terraform plan | |
run: terraform plan | |
- name: terraform apply | |
run: terraform apply -auto-approve |