mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat: add cloudflare pages for wiki
This commit is contained in:
parent
ffef284ee0
commit
c7d6938517
1 changed files with 43 additions and 0 deletions
43
tf/cloudflare_pages.tf
Normal file
43
tf/cloudflare_pages.tf
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
resource "cloudflare_pages_project" "wiki" {
|
||||
account_id = var.cloudflare_account_id
|
||||
name = "wiki"
|
||||
production_branch = "main"
|
||||
|
||||
source {
|
||||
type = "github"
|
||||
config {
|
||||
owner = "gensokyo-zone"
|
||||
repo_name = "wiki"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
}
|
||||
}
|
||||
build_config {
|
||||
build_command = "npx quartz build"
|
||||
destination_dir = "public"
|
||||
root_dir = "/"
|
||||
}
|
||||
lifecycle {
|
||||
ignore_changes = [
|
||||
deployment_configs,
|
||||
source
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
resource "cloudflare_pages_domain" "wiki" {
|
||||
account_id = var.cloudflare_account_id
|
||||
project_name = "wiki"
|
||||
domain = "wiki.gensokyo.zone"
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "wiki" {
|
||||
zone_id = cloudflare_zone.gensokyo-zone_zone.id
|
||||
name = "wiki"
|
||||
proxied = false
|
||||
ttl = 3600
|
||||
type = "CNAME"
|
||||
value = cloudflare_pages_project.wiki.subdomain
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue