-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |