Skip to content

create-space

create-space #4

Workflow file for this run

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: Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.4.7"
- name: Create file for space
run : |
cat > ${{ github.actor }}.software-engineer.space.tf << EOF
module "${{ inputs.dns_prefix }}" {
source = "./modules/software-engineer-space"
github_handle = "${{ github.actor }}"
domain_prefix = "${{ inputs.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 ${{ inputs.dns_prefix }}.software-engineer.space.tf"
git push
- name: Run terraform
run: |
terraform init
terraform apply -auto-approve
terraform apply -auto-approve