Merge pull request #26 from devblin/main #24
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 | |
on: | |
push: | |
branches: | |
- production | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
TF_VAR_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
TF_VAR_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
TF_VAR_ENV: ${{ vars.ENV }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup terraform | |
uses: hashicorp/setup-terraform@v1 | |
- name: Initialise terraform | |
run: | | |
terraform init | |
- name: Validate terraform | |
run: | | |
terraform validate | |
- name: Apply terraform | |
run: | | |
terraform apply -auto-approve |