Apply Terraform k8s Cluster #15
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: Apply Terraform k8s Cluster | |
| on: | |
| workflow_dispatch | |
| env: | |
| K8S_DIR: "./k8s-cluster" | |
| TF_VAR_yandex_provider: '{"token":"$YC_TOKEN","zone":"$YC_ZONE","folder_id":"$YC_FOLDER_ID","cloud_id":"$YC_CLOUD_ID"}' | |
| TF_BACKEND_CONFIG_ACCESS: "access_key=${{ secrets.ACCESS_KEY }}" | |
| TF_BACKEND_CONFIG_KEY: "secret_key=${{ secrets.SECRET_KEY }}" | |
| jobs: | |
| terraform: | |
| name: "Terraform Apply Cluster" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Terraform Setup | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: "~1.10.5" | |
| - name: Terraform init&validate (with Backend) | |
| working-directory: ${{ env.K8S_DIR }} | |
| run: | | |
| terraform init -backend-config=${{ env.TF_BACKEND_CONFIG_ACCESS }} \ | |
| -backend-config=${{ env.TF_BACKEND_CONFIG_KEY }} | |
| terraform validate | |
| - name: Terraform apply | |
| working-directory: ${{ env.K8S_DIR }} | |
| run: | | |
| terraform apply -auto-approve |