Skip to content

add deploy.yml

add deploy.yml #1

Workflow file for this run

name: "Terraform Cloud Deploy "
on:
push:
branches:
- main
env:
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}"
TF_API_URL: "app.terraform.io"
CONFIG_DIRECTORY: "./labs-17"
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout le code
uses: actions/checkout@v2
- name: Set up Terraform CLI
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.6.6 # Modifiez en fonction de la version souhaitée
- name: Configure Terraform Cloud
run: |
echo "credentials \"$TF_API_URL\" {" >> ~/.terraformrc
echo " token = \"${{ secrets.TF_TOKEN }}\"" >> ~/.terraformrc
echo "}" >> ~/.terraformrc
- name: Initialize Terraform
run: |
ls
terraform init
- name: Terraform plan
run: |
terraform plan -out=tfplan