Criando kustomization para ajudar a subir todos arquivos de uma vez e… #7
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: Deploy and Post-Deployment Tasks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
deploy_terraform1: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: '1.0.0' | |
- name: Set up AWS environment variables from secrets | |
run: | | |
echo "TF_VAR_aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV | |
echo "TF_VAR_aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV | |
echo "TF_VAR_aws_session_token=${{ secrets.AWS_SESSION_TOKEN }}" >> $GITHUB_ENV | |
echo "TF_VAR_regionDefault=${{ secrets.AWS_REGION }}" >> $GITHUB_ENV | |
- name: Terraform Init | |
run: terraform init -input=false | |
working-directory: . | |
- name: Terraform Validate | |
run: terraform validate | |
working-directory: . | |
- name: Terraform Plan | |
run: terraform plan -input=false | |
working-directory: . | |
- name: Terraform Apply | |
run: terraform apply -auto-approve | |
working-directory: . | |
id: apply |