-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.5 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
## This workflow is managed by meta-repo.
# Please do not edit here.
name: "Terraform"
on:
push:
branches:
- main
pull_request:
jobs:
terraform:
name: "Terraform"
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup SSH Keys and known_hosts
if: env.PRIVATE_KEY != null
env:
PRIVATE_KEY: ${{ secrets.SSH_KEY }}
run: |
SSH_PATH="$HOME/.ssh"
mkdir -p "$SSH_PATH"
touch "$SSH_PATH/known_hosts"
echo "$PRIVATE_KEY" > "$SSH_PATH/id_rsa"
chmod 700 "$SSH_PATH"
ssh-keyscan github.com >> ~/.ssh/known_hosts
chmod 600 "$SSH_PATH/known_hosts"
chmod 600 "$SSH_PATH/id_rsa"
eval $(ssh-agent)
ssh-add "$SSH_PATH/id_rsa"
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.1.5
- name: Terraform Format
id: fmt
run: terraform fmt -check -recursive
- name: Terraform Init
id: init
run: terraform init -backend=false
- name: Terraform Validate
env:
ACME_SERVER_URL: http://localhost
id: validate
run: terraform validate
- name: Bump version and push tag
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
id: tag_version
uses: mathieudutour/github-tag-action@v5.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}