feat(workflows): init terraform

This commit is contained in:
2023-12-09 10:23:24 +02:00
parent d75891b4c8
commit 8c153bb976
2 changed files with 54 additions and 0 deletions

View File

@@ -2,12 +2,18 @@ name: tf-apply
on: on:
workflow_call: workflow_call:
secrets: secrets:
gpg-key:
required: true
type: string
tf-api-token: tf-api-token:
required: true required: true
type: string
ssh-private-key: ssh-private-key:
required: true required: true
type: string
ssh-known-hosts: ssh-known-hosts:
required: true required: true
type: string
jobs: jobs:
tf-plan: tf-plan:
@@ -17,6 +23,20 @@ jobs:
tfplanexitcode: ${{ steps.tfplan.outputs.exitcode }} tfplanexitcode: ${{ steps.tfplan.outputs.exitcode }}
steps: steps:
- name: Clone blackbox repo
uses: actions/checkout@v4
with:
repository: xaked/blackbox
path: /tmp/blackbox
ref: master
- name: Decrypt secrets
shell: bash
run: |
cd /tmp/blackbox || exit 1;
make copy-install;
echo ${{ secrets.gpg-key }} | base64 -d | gpg --import;
cd ${{ github.workspace }};
blackbox_decrypt_all_files;
- uses: hashicorp/setup-terraform@v2 - uses: hashicorp/setup-terraform@v2
with: with:
terraform_version: 1.5.7 terraform_version: 1.5.7
@@ -71,6 +91,20 @@ jobs:
if: needs.tf-plan.outputs.tfplanexitcode == 2 if: needs.tf-plan.outputs.tfplanexitcode == 2
steps: steps:
- name: Clone blackbox repo
uses: actions/checkout@v4
with:
repository: xaked/blackbox
path: /tmp/blackbox
ref: master
- name: Decrypt secrets
shell: bash
run: |
cd /tmp/blackbox || exit 1;
make copy-install;
echo ${{ secrets.gpg-key }} | base64 -d | gpg --import;
cd ${{ github.workspace }};
blackbox_decrypt_all_files;
- uses: hashicorp/setup-terraform@v2 - uses: hashicorp/setup-terraform@v2
with: with:
terraform_version: 1.5.7 terraform_version: 1.5.7

View File

@@ -2,12 +2,18 @@ name: tf-plan
on: on:
workflow_call: workflow_call:
secrets: secrets:
gpg-key:
required: true
type: string
tf-api-token: tf-api-token:
required: true required: true
type: string
ssh-private-key: ssh-private-key:
required: true required: true
type: string
ssh-known-hosts: ssh-known-hosts:
required: true required: true
type: string
jobs: jobs:
tf-plan: tf-plan:
@@ -15,6 +21,20 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Clone blackbox repo
uses: actions/checkout@v4
with:
repository: xaked/blackbox
path: /tmp/blackbox
ref: master
- name: Decrypt secrets
shell: bash
run: |
cd /tmp/blackbox || exit 1;
make copy-install;
echo ${{ secrets.gpg-key }} | base64 -d | gpg --import;
cd ${{ github.workspace }};
blackbox_decrypt_all_files;
- uses: hashicorp/setup-terraform@v2 - uses: hashicorp/setup-terraform@v2
with: with:
terraform_version: 1.5.7 terraform_version: 1.5.7