add labs 17 #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: "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 |