-
Notifications
You must be signed in to change notification settings - Fork 2
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
8 changed files
with
350 additions
and
67 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,54 @@ | ||
name: Application AWS Terraform Apply | ||
description: Terraform apply for App AWS infra | ||
|
||
inputs: | ||
aws-access-key-id: | ||
description: >- | ||
AWS Access Key ID. This input is required if running in the GitHub hosted environment. | ||
required: true | ||
aws-secret-access-key: | ||
description: >- | ||
AWS Secret Access Key. This input is required if running in the GitHub hosted environment. | ||
required: true | ||
aws-region: | ||
description: 'AWS Region, e.g. us-east-2' | ||
required: true | ||
terraform-version: | ||
description: Terraform version to use | ||
required: false | ||
default: 1.4.6 | ||
terraform-directory: | ||
description: Directory where Terraform config is located | ||
required: false | ||
default: '.' | ||
envname: | ||
description: The Cloud Environment to run | ||
required: true | ||
github-org: | ||
description: GitHub Organization | ||
required: true | ||
github-token: | ||
description: GitHub Token | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- | ||
name: Application Terraform Plan | ||
uses: ./.github/actions/app-tf-plan | ||
with: | ||
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
aws-region: ${{ inputs.aws-region }} | ||
terraform-version: ${{ inputs.terraform-version }} | ||
terraform-directory: ${{ inputs.terraform-directory }} | ||
envname: ${{ inputs.envname }} | ||
github-org: ${{ inputs.github-org }} | ||
github-token: ${{ inputs.github-token }} | ||
|
||
- | ||
name: Application Terraform Apply | ||
working-directory: ${{ inputs.terraform-directory }} | ||
shell: bash | ||
run: terraform apply -no-color -auto-approve github-actions.tfplan |
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,64 @@ | ||
name: Application AWS Terraform Plan | ||
description: Terraform plan for App AWS infra | ||
|
||
inputs: | ||
aws-access-key-id: | ||
description: >- | ||
AWS Access Key ID. This input is required if running in the GitHub hosted environment. | ||
required: true | ||
aws-secret-access-key: | ||
description: >- | ||
AWS Secret Access Key. This input is required if running in the GitHub hosted environment. | ||
required: true | ||
aws-region: | ||
description: 'AWS Region, e.g. us-east-2' | ||
required: true | ||
terraform-version: | ||
description: Terraform version to use | ||
required: false | ||
default: 1.4.6 | ||
terraform-directory: | ||
description: Directory where Terraform config is located | ||
required: false | ||
default: '.' | ||
envname: | ||
description: The Cloud Environment to run | ||
required: true | ||
github-org: | ||
description: GitHub Organization | ||
required: true | ||
github-token: | ||
description: GitHub Token | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- | ||
name: AWS Login | ||
uses: ./.github/actions/aws-login | ||
with: | ||
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
aws-region: ${{ inputs.aws-region }} | ||
|
||
- | ||
name: GitHub Login | ||
uses: ./.github/actions/github-login | ||
with: | ||
github-org: ${{ inputs.github-org }} | ||
github-token: ${{ inputs.github-token }} | ||
|
||
- | ||
name: Initialize Terraform | ||
uses: ./.github/actions/terraform-init | ||
with: | ||
terraform-version: ${{ inputs.terraform-version }} | ||
terraform-directory: ${{ inputs.terraform-directory }} | ||
|
||
- name: Terraform plan | ||
uses: ./.github/actions/terraform-plan | ||
with: | ||
envname: ${{ inputs.envname }} | ||
github-token: ${{ inputs.github-token }} | ||
terraform-directory: ${{ inputs.terraform-directory }} |
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,31 @@ | ||
name: AWS Login | ||
description: Login to AWS | ||
|
||
inputs: | ||
aws-access-key-id: | ||
description: >- | ||
AWS Access Key ID. This input is required if running in the GitHub hosted environment. | ||
required: true | ||
aws-secret-access-key: | ||
description: >- | ||
AWS Secret Access Key. This input is required if running in the GitHub hosted environment. | ||
required: true | ||
aws-region: | ||
description: 'AWS Region, e.g. us-east-2' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- | ||
name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
aws-region: ${{ inputs.aws-region }} | ||
|
||
# - | ||
# name: Display AWS auth ID | ||
# run: aws sts get-caller-identity | ||
# shell: bash |
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,17 @@ | ||
name: 'GitHub Login' | ||
description: 'Gives this job access to private terraform modules.' | ||
inputs: | ||
github-org: | ||
description: 'The GitHub org that access is for' | ||
required: true | ||
github-token: | ||
description: 'GitHub token with access to private repos' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup private repo credentials for private modules | ||
shell: bash | ||
run: | | ||
git config --global url.'https://git:${{ inputs.github-token }}@github.com/${{ inputs.github-org }}'.insteadOf 'https://github.com/${{ inputs.github-org }}' | ||
git config --global url.'https://${{ inputs.github-token }}:[email protected]/${{ inputs.github-org }}'.insteadOf ssh://[email protected]/${{ inputs.github-org }} |
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
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
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,110 @@ | ||
name: Terraform - Plan | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
# paths: | ||
# - 'envs/**' | ||
# - 'modules/**' | ||
workflow_dispatch: | ||
permissions: | ||
id-token: write | ||
pull-requests: write | ||
contents: read # This is required for actions/checkout | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name }} | ||
cancel-in-progress: false | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
terraform-version: 1.4.6 | ||
aws-region: eu-central-1 | ||
github-org: 'Merit-Circle' | ||
|
||
run-name: ${{ github.workflow }} by @${{ github.actor }} from ${{ github.ref_name }} | ||
|
||
jobs: | ||
testeu-terraform-plan: | ||
name: testeu TF Plan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout GitHub Repo | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: Application Terraform Plan | ||
uses: ./.github/actions/app-tf-plan | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.aws-region }} | ||
terraform-version: ${{ env.terraform-version }} | ||
terraform-directory: "envs/test-eu" | ||
envname: "testeu" | ||
github-org: ${{ env.github-org }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
acceu-terraform-plan: | ||
name: acceu TF Plan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout GitHub Repo | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: Application Terraform Plan | ||
uses: ./.github/actions/app-tf-plan | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.aws-region }} | ||
terraform-version: ${{ env.terraform-version }} | ||
terraform-directory: "envs/acc-eu" | ||
envname: "acceu" | ||
github-org: ${{ env.github-org }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
prdeutestnet-terraform-plan: | ||
name: prdeutestnet TF Plan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout GitHub Repo | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: Application Terraform Plan | ||
uses: ./.github/actions/app-tf-plan | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.aws-region }} | ||
terraform-version: ${{ env.terraform-version }} | ||
terraform-directory: "envs/prd-testnet" | ||
envname: "prdeutestnet" | ||
github-org: ${{ env.github-org }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
prdeu-terraform-plan: | ||
name: prdeu TF Plan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout GitHub Repo | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: Application Terraform Plan | ||
uses: ./.github/actions/app-tf-plan | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.aws-region }} | ||
terraform-version: ${{ env.terraform-version }} | ||
terraform-directory: "envs/prd-eu" | ||
envname: "prdeu" | ||
github-org: ${{ env.github-org }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.