Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions .github/workflows/apply-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Apply DEV

on:
push:
branches-ignore:
- master

jobs:
apply-dev:
uses: ./.github/workflows/shared-tf-apply.yml
with:
environment: dev
secrets:
bitwarden_access_token: ${{ secrets.BITWARDEN_API_TOKEN_DEV }}
azuread_credentials: ${{ secrets.AZUREAD_CREDENTIALS_DEV }}
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
pagerduty_api_token: ${{ secrets.PAGERDUTY_API_TOKEN_DEV }}
b2_application_key_id: ${{ secrets.B2_APPLICATION_KEY_ID }}
b2_application_key: ${{ secrets.B2_APPLICATION_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/apply-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Apply PROD

on:
push:
branches:
- master

jobs:
apply-dev:
uses: ./.github/workflows/shared-tf-apply.yml
with:
environment: prod
secrets:
bitwarden_access_token: ${{ secrets.BITWARDEN_API_TOKEN_PROD }}
azuread_credentials: ${{ secrets.AZUREAD_CREDENTIALS_PROD }}
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
pagerduty_api_token: ${{ secrets.PAGERDUTY_API_TOKEN_PROD }}
b2_application_key_id: ${{ secrets.B2_APPLICATION_KEY_ID }}
b2_application_key: ${{ secrets.B2_APPLICATION_KEY }}
71 changes: 0 additions & 71 deletions .github/workflows/ci.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/plan-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Plan PROD

on:
pull_request:
branches:
- master

jobs:
plan-prod:
uses: ./.github/workflows/shared-tf-plan.yml
with:
environment: prod
secrets:
bitwarden_access_token: ${{ secrets.BITWARDEN_API_TOKEN_PROD }}
azuread_credentials: ${{ secrets.AZUREAD_CREDENTIALS_PROD }}
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
pagerduty_api_token: ${{ secrets.PAGERDUTY_API_TOKEN_PROD }}
b2_application_key_id: ${{ secrets.B2_APPLICATION_KEY_ID }}
b2_application_key: ${{ secrets.B2_APPLICATION_KEY }}
52 changes: 52 additions & 0 deletions .github/workflows/shared-tf-apply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
bitwarden_access_token:
required: true
bitwarden_project_id:
required: true
azuread_credentials:
required: true
cloudflare_api_token:
required: true
pagerduty_api_token:
required: true
b2_application_key_id:
required: true
b2_application_key:
required: true

jobs:
terraform-apply:
runs-on: ubuntu-latest
env:
TF_WORKSPACE: ${{ inputs.environment }}
TF_VAR_bitwarden_access_token: ${{ secrets.bitwarden_access_token }}
TF_VAR_aad_credentials: ${{ secrets.azuread_credentials }}
TF_VAR_cloudflare_api_token: ${{ secrets.cloudflare_api_token }}
TF_VAR_pagerduty_api_token: '${{ secrets.pagerduty_api_token }}'
TF_VAR_bitwarden_project_id: ${{ secrets.bitwarden_project_id }}
TF_VAR_B2_APPLICATION_KEY_ID: ${{ secrets.b2_application_key_id }}
TF_VAR_B2_APPLICATION_KEY: ${{ secrets.b2_application_key }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3

- name: Terraform Init
run: terraform init -input=false
working-directory: ./terraform

- name: Terraform Plan
run: terraform plan -input=false -var-file=../environments/${{ inputs.environment }}.tfvars -out=tfplan
working-directory: ./terraform

- name: Terraform Apply
run: terraform apply -input=false -var-file=../environments/${{ inputs.environment }}.tfvars -auto-approve tfplan
working-directory: ./terraform
48 changes: 48 additions & 0 deletions .github/workflows/shared-tf-plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
bitwarden_access_token:
required: true
bitwarden_project_id:
required: true
azuread_credentials:
required: true
cloudflare_api_token:
required: true
pagerduty_api_token:
required: true
b2_application_key_id:
required: true
b2_application_key:
required: true

jobs:
terraform-plan:
runs-on: ubuntu-latest
env:
TF_WORKSPACE: ${{ inputs.environment }}
TF_VAR_bitwarden_access_token: ${{ secrets.bitwarden_access_token }}
TF_VAR_aad_credentials: ${{ secrets.azuread_credentials }}
TF_VAR_cloudflare_api_token: ${{ secrets.cloudflare_api_token }}
TF_VAR_pagerduty_api_token: '${{ secrets.pagerduty_api_token }}'
TF_VAR_bitwarden_project_id: ${{ secrets.bitwarden_project_id }}
TF_VAR_b2_application_key_id: ${{ secrets.b2_application_key_id }}
TF_VAR_b2_application_key: ${{ secrets.b2_application_key }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3

- name: Terraform Init
run: terraform init -input=false
working-directory: ./terraform

- name: Terraform Plan
run: terraform plan -input=false -var-file=../environments/${{ inputs.environment }}.tfvars
working-directory: ./terraform
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
creds.*.tfvars

# Local .terraform directories
**/.terraform/*

Expand Down
6 changes: 0 additions & 6 deletions .sops.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions environments/dev.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
environment_name = "dev"
root_domain = "homecentr.one"
pagerduty_tenant_domain = "homecentr-lab.eu.pagerduty.com"
3 changes: 3 additions & 0 deletions environments/prod.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
environment_name = "prod"
root_domain = "homecentr.one"
pagerduty_tenant_domain = "homecentr.eu.pagerduty.com"
31 changes: 0 additions & 31 deletions environments/secrets.prod.yml

This file was deleted.

Loading