name: SES - juntekim.com [Simple Email Service] on: pull_request: push: branches: - main paths: - "aws_environment/ses-juntekim/**" workflow_dispatch: env: TF_VERSION: "1.6.6" WORKING_DIR: "aws_environment/ses-juntekim" jobs: terraform: name: Terraform SES runs-on: mealcraft-runners permissions: contents: read pull-requests: write steps: - name: Checkout repo uses: actions/checkout@v4 - name: Install modern Node.js run: | curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs node --version - name: Setup Terraform uses: hashicorp/setup-terraform@v3 with: terraform_version: ${{ env.TF_VERSION }} - name: Install AWS CLI run: | sudo apt-get update sudo apt-get install -y awscli # Optional but recommended once - name: Verify AWS identity run: aws sts get-caller-identity - name: Terraform Init working-directory: ${{ env.WORKING_DIR }} run: terraform init - name: Terraform Validate working-directory: ${{ env.WORKING_DIR }} run: terraform validate - name: Terraform Plan if: github.event_name == 'pull_request' working-directory: ${{ env.WORKING_DIR }} run: terraform plan -input=false - name: Terraform Apply if: github.ref == 'refs/heads/main' working-directory: ${{ env.WORKING_DIR }} run: terraform apply -auto-approve