Skip to content

Commit

Permalink
Add workflow to create spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tpreviero committed Mar 23, 2024
1 parent e0687ac commit 9af0897
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/create-space.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: create-space
on:
workflow_dispatch:
inputs:
dns_prefix:
required: true
type: string

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create file for space
run : |
cat > ${{ github.actor }}.software-engineer.space.tf << EOF
module "${{ dns_prefix }}" {
source = "./modules/software-engineer-space"
github_handle = "${{ github.actor }}"
domain_prefix = "${{ dns_prefix }}"
cloudflare_zone_id = cloudflare_zone.software-engineer-space.id
providers = {
cloudflare = cloudflare
github = github
}
}
EOF
- name: Commit the new file for space
run: |
git config user.name github-actions
git config user.email [email protected]
git add ${{ github.actor }}.software-engineer.space.tf
git commit -am "Add space for ${{ github.actor }} as ${{ dns_prefix }}.software-engineer.space.tf"
git push
- name: Run terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.4.7"
run: |
terraform init
terraform apply -auto-approve
terraform apply -auto-approve

0 comments on commit 9af0897

Please sign in to comment.