Skip to content

Commit

Permalink
add terraform pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyanio committed Oct 21, 2020
1 parent 0d96dd2 commit 42c356d
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'Terraform GitHub Actions'
on:
pull_request:
branches:
- master

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
aws-region: us-east-2

- name: 'Terraform Format'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'fmt'

- name: 'Terraform init basic-s3_example'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/basic-s3_function

- name: 'Terraform validate basic-s3_example'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/basic-s3_function

- name: 'Terraform init basic_function'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/basic_function

- name: 'Terraform validate basic_function'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/basic_function

- name: 'Terraform init complete_example'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/complete_function

- name: 'Terraform validate complete_example'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/complete_function

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()

0 comments on commit 42c356d

Please sign in to comment.