Skip to content

Commit

Permalink
Merge pull request #6 from nkordis/terraform-apply
Browse files Browse the repository at this point in the history
ci: add Terraform apply job
  • Loading branch information
nkordis authored May 26, 2024
2 parents bba9a1b + 01dc051 commit 1199d55
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,18 @@ jobs:
docker push ${{ vars.ECR_REPO_APP }}:$GITHUB_SHA
docker build --compress -t ${{ vars.ECR_REPO_PROXY }}:$GITHUB_SHA proxy/
docker push ${{ vars.ECR_REPO_PROXY }}:$GITHUB_SHA
- name: Terraform Apply
env:
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_db_password: ${{ secrets.TF_VAR_DB_PASSWORD }}
TF_VAR_django_secret_key: ${{ secrets.TF_VAR_DJANGO_SECRET_KEY }}
run: |
export TF_VAR_ecr_app_image="${{ vars.ECR_REPO_APP }}:$GITHUB_SHA"
export TF_VAR_ecr_proxy_image="${{ vars.ECR_REPO_PROXY }}:$GITHUB_SHA"
workspace=$(cat .workspace)
cd infra/
docker compose run --rm terraform -chdir=deploy/ init
docker compose run --rm terraform -chdir=deploy/ workspace select -or-create $workspace
docker compose run --rm terraform -chdir=deploy/ apply -auto-approve

0 comments on commit 1199d55

Please sign in to comment.