-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (32 loc) · 895 Bytes
/
ci.yaml
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
name: 'Terraform'
on:
push:
branches:
- main
pull_request:
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request' }}
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Checkout
uses: actions/checkout@v3
if: ${{ github.event_name == 'push' }}
with:
ref: ${{ github.ref_name }}
- name: Setup terraform
uses: hashicorp/setup-terraform@v1
- name: Terraform Init
run: terraform init
- name: Terraform Format
run: terraform fmt -check -recursive
- name: Render terraform docs and push changes back to PR
uses: terraform-docs/gh-actions@main
with:
config-file: .terraform-docs.yml
working-dir: .
git-push: "true"