Skip to content

remove mollycollins.me #39

remove mollycollins.me

remove mollycollins.me #39

name: Deploy Terraform
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "terraform/**"
pull_request:
paths:
- "terraform/**"
jobs:
terraform_apply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
- name: Terraform Init
working-directory: terraform
run: terraform init
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Terraform plan
working-directory: terraform
run: terraform plan
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Terraform apply
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: terraform
run: terraform apply -auto-approve
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}