Remove redundant deploy workflow #2
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
| steps: | ||
| - name: Terraform Init & Validate | ||
| run: | | ||
| terraform init -input=false | ||
| terraform fmt -check | ||
| terraform validate | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| - name: Terraform Plan | ||
| run: | | ||
| terraform plan -out=tfplan -input=false | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| - name: Require manual approval before apply | ||
| uses: peter-evans/repository-dispatch@v2 | ||
| with: | ||
| event-type: request-terraform-apply | ||
| - name: Terraform Apply (manual) | ||
| if: github.event.action == 'approved' | ||
| run: terraform apply -input=false tfplan | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| - name: Deploy to ECS | ||
| if: success() | ||
| run: | | ||
| aws ecs update-service --cluster quest-cluster --service quest-service --force-new-deployment | ||
| aws ecs update-service --cluster quest-cluster --service quest-service --desired-count 1 | ||