Manual - Apply changes #287
Workflow file for this run
This file contains hidden or 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: Manual - Apply changes | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| type: choice | |
| description: Which environment to deploy to | |
| required: true | |
| default: staging | |
| options: | |
| - staging | |
| - production | |
| jobs: | |
| terraform_deployment: | |
| environment: ${{ inputs.environment }} # secrets are set per environment https://github.com/openbraininstitute/aws-terraform-deployment/settings/environments | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| runs-on: ubuntu-latest | |
| name: Manual terraform apply | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Configure Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| - name: Terraform format check | |
| run: terraform fmt -check -diff -recursive | |
| - name: Initialize Terraform | |
| run: terraform init -backend-config="./${{ inputs.environment }}.config" | |
| - name: Run Terraform Plan | |
| run: | | |
| terraform plan -input=false -var-file="${{ inputs.environment }}.tfvars" -out plan.tfplan >/dev/null && terraform show plan.tfplan | |
| - name: Run Terraform Apply | |
| run: | | |
| terraform apply -auto-approve -var-file="${{ inputs.environment }}.tfvars" |