Full build with test and removed waiting in deploy.yml #8
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
| name: "Terraform Infrastructure" | |
| on: | |
| push: | |
| branches: | |
| - "main" # Safety: Only run on main branch | |
| paths: | |
| - "terraform/**" # Only run if files in this folder change | |
| jobs: | |
| terraform: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./terraform | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| - name: Terraform Init & Apply | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: "ap-southeast-1" # Ensure this matches your provider | |
| run: | | |
| terraform init | |
| terraform apply -auto-approve |