Skip to content

Commit 68315dc

Browse files
authored
Merge pull request #6 from scribd/cidev
ci: test terraform validity
2 parents 632a0fe + 716a042 commit 68315dc

File tree

2 files changed

+60
-24
lines changed

2 files changed

+60
-24
lines changed

.github/workflows/rspec_and_release.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
terraform:
9+
name: 'Terraform'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout'
13+
uses: actions/checkout@master
14+
15+
- name: 'Terraform Format'
16+
uses: hashicorp/terraform-github-actions@master
17+
with:
18+
tf_actions_version: 0.12.24
19+
tf_actions_subcommand: 'fmt'
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- name: 'Terraform Init'
23+
uses: hashicorp/terraform-github-actions@master
24+
with:
25+
tf_actions_version: 0.12.24
26+
tf_actions_subcommand: 'init'
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: 'Inject provider configs for validate command'
31+
run: |
32+
cat > providers.tf <<EOF
33+
provider "aws" {
34+
region = "us-east-2"
35+
}
36+
EOF
37+
- name: 'Terraform Validate'
38+
uses: hashicorp/terraform-github-actions@master
39+
with:
40+
tf_actions_version: 0.12.24
41+
tf_actions_subcommand: 'validate'
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
release:
45+
if: github.event_name == 'push'
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Semantic Release
51+
id: semantic
52+
uses: cycjimmy/semantic-release-action@v2
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
semantic_version: 17
57+
extra_plugins: |
58+
@semantic-release/changelog
59+
@semantic-release/git
60+

0 commit comments

Comments
 (0)