ci: add terraform workflow #1
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| # S3 backend configuration | |
| AWS_ENDPOINT_URL_S3: ${{ vars.AWS_ENDPOINT_URL_S3 }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| # GitHub App configuration | |
| GITHUB_OWNER: ${{ vars.GH_OWNER }} | |
| GITHUB_APP_ID: ${{ vars.GH_APP_ID }} | |
| GITHUB_APP_INSTALLATION_ID: ${{ vars.GH_APP_INSTALLATION_ID }} | |
| GITHUB_APP_PEM_FILE: ${{ secrets.GH_APP_PEM_FILE }} | |
| # Terraform configuration | |
| TF_WORKSPACE: ${{ github.repository_owner }} | |
| TF_VAR_config: test.yaml | |
| TF_IN_AUTOMATION: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| terraform: | |
| name: Terraform Apply | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Terraform | |
| uses: hashicorp/setup-terraform@v4 | |
| with: | |
| terraform_version: 1.14.7 | |
| - name: Terraform init | |
| id: init | |
| run: terraform -chdir=terraform init -input=false | |
| - name: Terraform Apply | |
| run: terraform -chdir=terraform apply -auto-approve -input=false |