tf: email service #27
Workflow file for this run
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: Terraform | |
on: | |
pull_request: | |
paths: | |
- 'infrastructure/**' | |
jobs: | |
plan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Create SSH key file | |
run: | | |
mkdir ~/.ssh | |
echo "${{ secrets.AWS_EC2_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
- name: Terraform Init | |
run: terraform init | |
working-directory: ./infrastructure | |
shell: bash | |
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 | |
working-directory: ./infrastructure | |
shell: bash | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
TF_VAR_db_username: ${{ secrets.TF_VAR_DB_USERNAME }} | |
TF_VAR_db_password: ${{ secrets.TF_VAR_DB_PASSWORD }} |