Update our deploy to use the new terraform action
@@ -5,6 +5,9 @@ on:
branches:
- master
+env:
+ TF_WORKSPACE: "production"
+
jobs:
build-and-push-backend:
runs-on: ubuntu-latest
@@ -40,34 +43,26 @@ jobs:
terraform:
runs-on: ubuntu-latest
needs: [build-lambda-backend]
-
+ defaults:
+ run:
+ working-directory: ./infrastructure
steps:
- uses: actions/checkout@master
-
- - name: terraform-init
- uses: hashicorp/terraform-github-actions/init@v0.7.1
+ - uses: hashicorp/setup-terraform@v1
with:
- tf_actions_version: 0.13.3
+ terraform_version: 0.13.3
+ - name: Terraform Init
+ run: terraform init
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- TF_ACTION_WORKING_DIR: ./infrastructure
+ - name: Terraform Validate
+ id: validate
+ run: terraform validate -no-color
- - name: terraform-validate
- uses: hashicorp/terraform-github-actions/validate@v0.7.1
- with:
- tf_actions_version: 0.13.3
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- TF_ACTION_WORKING_DIR: ./infrastructure
-
- - name: terraform-apply
- uses: hashicorp/terraform-github-actions/apply@v0.7.1
- with:
- tf_actions_version: 0.13.3
+ - name: Terraform apply
+ run: terraform apply -no-color -auto-approve
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -85,8 +80,6 @@ jobs:
TF_VAR_pretix_secret_key: ${{ secrets.TF_VAR_pretix_secret_key }}
TF_VAR_pretix_api_token: ${{ secrets.TF_VAR_pretix_api_token }}
TF_VAR_pinpoint_application_id: ${{ secrets.TF_VAR_pinpoint_application_id }}
- TF_ACTION_WORKING_DIR: ./infrastructure
- TF_ACTION_WORKSPACE: production
deploy-to-eb:
runs-on: ubuntu-latest
