-
Notifications
You must be signed in to change notification settings - Fork 82
/
main.tf
50 lines (44 loc) · 1.18 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
terraform {
required_providers {
github = {
source = "integrations/github"
version = "~> 5.0"
}
}
}
provider "github" {
owner = var.destination_org
token = var.gh_token
}
resource "github_repository" "gh_repo" {
name = var.waypoint_application
visibility = "public"
template {
owner = var.template_org
repository = var.template_repo
include_all_branches = false
}
# Enable GitHub pages
pages {
build_type = "workflow"
}
}
resource "github_repository_file" "readme" {
repository = github_repository.gh_repo.name
branch = "main"
file = "README.md"
content = templatefile("${path.module}/templates/README.md", {
application_name = var.waypoint_application,
destination_org = var.destination_org
})
commit_message = "Added readme file."
commit_author = "Platform team"
commit_email = "[email protected]"
overwrite_on_create = true
}
resource "github_actions_environment_secret" "slack_hook_url" {
repository = github_repository.gh_repo.name
environment = "github-pages"
secret_name = "SLACK_HOOK_URL"
plaintext_value = var.slack_hook_url
}