Skip to content

Commit

Permalink
pass secrets as env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
juan pablo committed Aug 12, 2024
1 parent 0ef6139 commit 1f101f1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 51 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/go-ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go-continuous-integration
name: continuous-integration

on:
pull_request:
Expand All @@ -16,6 +16,8 @@ env:
GO_VERSION: v1.22.0
GOLANGCI_LINT_VERSION: v1.59
GOPRIVATE: github.com/intercloud
TF_VERSION: 1.9.0
TF_MODULE_PATH: examples/autonomi

jobs:
markdown-lint:
Expand Down Expand Up @@ -68,7 +70,7 @@ jobs:
go-test:
runs-on: ubuntu-latest
needs:
- go-mod-tidy
- golangci-lint
steps:
- name: checkout code
uses: actions/checkout@v4
Expand All @@ -78,3 +80,37 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: go test
run: go test ./... -v

tf-validate:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform init
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform init
- name: terraform validate
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform validate

tf-plan:
runs-on: ubuntu-latest
needs:
- tf-validate
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: set up terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform plan
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform plan
env:
TF_VAR_pat_token: ${{ secrets.TF_VAR_PAT_TOKEN }}
TF_VAR_aws_account_id: ${{ secrets.TF_VAR_AWS_ACCOUNT_ID }}
49 changes: 0 additions & 49 deletions .github/workflows/tf-ci.yml

This file was deleted.

0 comments on commit 1f101f1

Please sign in to comment.