Automate Service Provisioning with Terraform #2
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: Automate Service Provisioning with Terraform | ||
on: | ||
push: | ||
branches: | ||
- rk/infra-automation | ||
paths: | ||
- 'infrastructure/terraform' | ||
workflow_dispatch: | ||
env: | ||
WORKSPACE: ${{ GITHUB_REF_NAME }} | ||
Check failure on line 12 in .github/workflows/terraform-pipeline.yml
|
||
REPOSITORY: ${{ github.repository }} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set TF Backend | ||
shell: bash | ||
run: echo "terraform backend" | ||
- name: Initialize Terraform | ||
shell: bash | ||
run: echo "terraform init" | ||
- name: Set Terraform Workspace | ||
shell: bash | ||
run: echo "terraform workspace select ${{ env.WORKSPACE }}" | ||
- name: Plan Terraform | ||
shell: bash | ||
run: echo "terraform plan -out tfplan" | ||
- name: Approval Gate to Apply Terraform | ||
shell: bash | ||
run: echo "terraform approval gate" | ||
- name: Apply Terraform | ||
shell: bash | ||
run: echo "terraform apply tfplan" |