-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (39 loc) · 1.16 KB
/
terraform.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "Terraform"
on:
workflow_dispatch:
push:
branches: ["master"]
permissions:
contents: read
concurrency:
group: deploy
jobs:
terraform:
name: "Terraform"
runs-on: ubuntu-latest
environment: production
defaults:
run:
shell: bash
working-directory: ./terraform
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
run: terraform init
- name: Terraform Format
run: terraform fmt -check
- name: Terraform Apply
env:
TF_VAR_hcloud_token: ${{ secrets.TF_VAR_HCLOUD_TOKEN }}
TF_VAR_cloudflare_api_token: ${{ secrets.TF_VAR_CLOUDFLARE_API_TOKEN }}
TF_VAR_cloudflare_zone_id: ${{ secrets.TF_VAR_CLOUDFLARE_ZONE_ID }}
TF_VAR_elastic_cloud_id: ${{ secrets.TF_VAR_ELASTIC_CLOUD_ID }}
TF_VAR_elastic_api_key: ${{ secrets.TF_VAR_ELASTIC_API_KEY }}
run: |
terraform plan -input=false
terraform apply -auto-approve -input=false