generated from knoedel/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 1.83 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: terraform
on:
push:
branches:
- '*'
jobs:
terraform:
name: Terraform
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.0
terraform_wrapper: false
- name: Terraform Init
run: terraform init
- name: Install terraform-docs
uses: jaxxstorm/action-install-gh-release@v1.2.0
with:
repo: terraform-docs/terraform-docs
tag: v0.14.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: cache pre-commit
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run Checks
uses: pre-commit/action@v2.0.3
- name: Run Terraform Tests
run: scripts/make-test
env:
TFE_TOKEN: ${{ secrets.TFE_TOKEN_TESTING }}
- name: Bump version and push tag
if: github.ref == 'refs/heads/master'
id: tag_version
uses: mathieudutour/github-tag-action@v5.5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
if: github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v0.1.8
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}