diff --git a/flake.lock b/flake.lock index 1b52d1bbf..8a9f4efe3 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "base16-schemes": { "flake": false, "locked": { - "lastModified": 1665690101, - "narHash": "sha256-J2ZvNaVFkqaTXzYO5L+jyRORfIOavFPKvWItP6UTMKs=", + "lastModified": 1689473676, + "narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=", "owner": "tinted-theming", "repo": "base16-schemes", - "rev": "a3dc916cf90471a422c0bfe1bb4b1bdd12185ced", + "rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1674127017, - "narHash": "sha256-QO1xF7stu5ZMDLbHN30LFolMAwY6TVlzYvQoUs1RD68=", + "lastModified": 1698921442, + "narHash": "sha256-7KmvhQ7FuXlT/wG4zjTssap6maVqeAMBdtel+VjClSM=", "owner": "serokell", "repo": "deploy-rs", - "rev": "8c9ea9605eed20528bf60fae35a2b613b901fd77", + "rev": "660180bbbeae7d60dad5a92b30858306945fd427", "type": "github" }, "original": { @@ -62,11 +62,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1679738842, - "narHash": "sha256-CvqRbsyDW756EskojZptDU590rez29RcHDV3ezoze08=", + "lastModified": 1685325875, + "narHash": "sha256-tevlLIMPeVNNYPd9UgjHApAUoFAnw9iohqUyj+LPp88=", "owner": "nix-community", "repo": "home-manager", - "rev": "83110c259889230b324bb2d35bef78bf5f214a1f", + "rev": "b372d7f8d5518aaba8a4058a453957460481afbc", "type": "github" }, "original": { @@ -82,11 +82,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1672236234, - "narHash": "sha256-dpBIuxcDEvJbLD8fTipE0A0JbQD1lZB94zYFPoh01PI=", + "lastModified": 1695388192, + "narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=", "owner": "misterio77", "repo": "nix-colors", - "rev": "7e459f1d88ac54fc2f4b308adb5064863006e4b1", + "rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c", "type": "github" }, "original": { @@ -97,11 +97,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1680070330, - "narHash": "sha256-aoT2YZCd9LEtiEULFLIF0ykKydgE72X8gw/k9/pRS5I=", + "lastModified": 1700559156, + "narHash": "sha256-gL4epO/qf+wo30JjC3g+b5Bs8UrpxzkhNBBsUYxpw2g=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "a6aa8174fa61e55bd7e62d35464d3092aefe0421", + "rev": "c3abafb01cd7045dba522af29b625bd1e170c2fb", "type": "github" }, "original": { @@ -113,11 +113,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1679966490, - "narHash": "sha256-k0jV+y1jawE6w4ZvKgXDNg4+O9NNtcaWwzw8gufv0b4=", + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5b7cd5c39befee629be284970415b6eb3b0ff000", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", "type": "github" }, "original": { @@ -129,11 +129,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1655599917, - "narHash": "sha256-kjZbt5WdTrnjMxL79okg9TCoRUdADG50x/TWozbyTsE=", + "lastModified": 1694911725, + "narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "5fb55578aa2f1a502d636a8ac71aece57cb730bb", + "rev": "819180647f428a3826bfc917a54449da1e532ce0", "type": "github" }, "original": { @@ -144,11 +144,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1680121753, - "narHash": "sha256-rB3ZnNodA4o8Rq0sKZ0t/YdY/MRon4V+bW1b20adgr4=", + "lastModified": 1700955187, + "narHash": "sha256-Ch0+4eOeEp9sPaFm3oFcgSIe8OMYPfsMLJLOeqEj1Rs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e779e17ebdf3907ce08c75c7c1b2dc8a1c5038c9", + "rev": "3c9dd1c8a244aec0ef6e536519c0e1df00665f0b", "type": "github" }, "original": { @@ -160,27 +160,27 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1679748960, - "narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=", + "lastModified": 1700342017, + "narHash": "sha256-HaibwlWH5LuqsaibW3sIVjZQtEM/jWtOHX4Nk93abGE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "da26ae9f6ce2c9ab380c0f394488892616fc5a6a", + "rev": "decdf666c833a325cb4417041a90681499e06a41", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-22.11", + "ref": "release-23.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1679944645, - "narHash": "sha256-e5Qyoe11UZjVfgRfwNoSU57ZeKuEmjYb77B9IVW7L/M=", + "lastModified": 1700794826, + "narHash": "sha256-RyJTnTNKhO0yqRpDISk03I/4A67/dp96YRxc86YOPgU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4bb072f0a8b267613c127684e099a70e1f6ff106", + "rev": "5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8", "type": "github" }, "original": { @@ -210,11 +210,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1679993313, - "narHash": "sha256-pfZ/BxJDTifnQBMXg60OhwpJvg96LHvEXGtpHeGcWLM=", + "lastModified": 1700362823, + "narHash": "sha256-/H7XgvrYM0IbkpWkcdfkOH0XyBM5ewSWT1UtaLvOgKY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "5b26523e28989a7f56953b695184070c06335814", + "rev": "49a87c6c827ccd21c225531e30745a9a6464775c", "type": "github" }, "original": { diff --git a/terraform/github/repository.tf b/terraform/github/repository.tf index 4d17f6767..6fb2bdafe 100644 --- a/terraform/github/repository.tf +++ b/terraform/github/repository.tf @@ -7,7 +7,7 @@ module "github_repository" { homepage_url = each.value.homepage_url visibility = each.value.visibility collaborators = each.value.collaborators + pages = each.value.pages has_discussions = each.value.has_discussions - has_pages = each.value.has_pages is_archived = each.value.is_archived } diff --git a/terraform/github/terraform.tfvars b/terraform/github/terraform.tfvars index 728b75f5f..8ff410f7d 100755 --- a/terraform/github/terraform.tfvars +++ b/terraform/github/terraform.tfvars @@ -3,58 +3,56 @@ changeset_bot_installation_id = "35785996" default_branch = "main" repositories = { - awesome-effect = { - has_pages = false - } + awesome-effect = {} babel-plugin = { description = "A babel plugin purpose-built for the Effect ecosystem" homepage_url = "https://effect-ts.github.io/babel-plugin" + pages = { build_type = "legacy" } } build-utils = { description = "Custom utilities used to assist with building and packaging Effect libraries" homepage_url = "https://effect-ts.github.io/build-utils" + pages = { build_type = "legacy" } } cache = { description = "An Effect native cache with a simple and compositional interface" homepage_url = "https://effect-ts.github.io/cache" + pages = { build_type = "legacy" } is_archived = true } cli = { description = "Rapidly build powerful and composable command-line applications" homepage_url = "https://effect-ts.github.io/cli" + pages = { build_type = "legacy" } } - cluster = { - has_pages = false - } + cluster = {} data = { description = "Custom built data types leveraged by the Effect ecosystem" collaborators = [{ username = "enricopolanski", permission = "push" }] homepage_url = "https://effect-ts.github.io/data" + pages = { build_type = "legacy" } is_archived = true } discord-bot = { description = "The Effect Community's custom Discord bot, built with Effect" - has_pages = false } docgen = { description = "An opinionated documentation generator for Effect projects" homepage_url = "https://effect-ts.github.io/docgen" + pages = { build_type = "legacy" } } docs-ai = { description = "Experimentation with artificial intelligence for augmenting Effect's documentation" enable_changesets = false - has_pages = false visibility = "private" } discord-bot = { description = "The Effect Community's custom Discord bot, built with Effect" collaborators = [{ username = "tim-smart", permission = "push" }] enable_changesets = false - has_pages = false } dtslint = { description = "Effect's custom fork of dtslint used to lint TypeScript declaration (.d.ts) files" - has_pages = false } effect = { description = "A fully-fledged functional effect system for TypeScript with a rich standard library" @@ -64,24 +62,23 @@ repositories = { { username = "remiguittaut", permission = "push" }, { username = "rzeigler", permission = "push" }, ] + pages = { build_type = "legacy" } homepage_url = "https://www.effect.website" topics = ["effect-system", "fp", "framework", "stack-safe", "typescript", "zio"] } eslint-plugin = { description = "A set of ESlint and TypeScript rules to work with Effect" - has_pages = false } examples = { description = "A repository of examples showing how to use Effect" - has_pages = false } experimental = { description = "A repository for experimental Effect libraries" homepage_url = "https://effect-ts.github.io/experimental" + pages = { build_type = "legacy" } } figlet = { description = "An implementation of a FIGlet font parser and renderer built with Effect" - has_pages = false } # Comment in once the repo has commits # general-issues = { @@ -91,82 +88,84 @@ repositories = { infra = { description = "Infrastructure relevant to the Effect organization" enable_changesets = false - has_pages = false } io = { description = "Effect's core runtime, a fiber-based implementation of structured concurrency" homepage_url = "https://effect-ts.github.io/io" + pages = { build_type = "legacy" } is_archived = true } - language-service = { - has_pages = false - } + language-service = {} match = { description = "Functional pattern matching with the full power of TypeScript" collaborators = [{ username = "tim-smart", permission = "maintain" }] + pages = { build_type = "legacy" } homepage_url = "https://effect-ts.github.io/match" topics = ["functional-programming", "pattern-matching", "typescript"] is_archived = true } monorepo-testing = { collaborators = [{ username = "fubhy", permission = "push" }] - has_pages = false } opentelemetry = { description = "OpenTelemetry integration with Effect" homepage_url = "https://effect-ts.github.io/opentelemetry" + pages = { build_type = "legacy" } } platform = { description = "Unified interfaces for common platform-specific services" homepage_url = "https://effect-ts.github.io/platform" + pages = { build_type = "legacy" } } printer = { description = "An easy to use, extensible pretty-printer for rendering documents" homepage_url = "https://effect-ts.github.io/printer" + pages = { build_type = "legacy" } } rpc = { description = "" homepage_url = "https://effect-ts.github.io/rpc" + pages = { build_type = "legacy" } } scala-playground = { description = "A Scala playground for the Effect maintainers" - has_pages = false } schema = { description = "Modeling the schema of data structures as first-class values" homepage_url = "https://effect-ts.github.io/schema" + pages = { build_type = "legacy" } } stm = { description = "An implementation of software transactional memory built with Effect" homepage_url = "https://effect-ts.github.io/stm" + pages = { build_type = "legacy" } is_archived = true } stream = { description = "An implementation of pull-based streams built with Effect" homepage_url = "https://effect-ts.github.io/stream" + pages = { build_type = "legacy" } is_archived = true } team = { visibility = "private" enable_changesets = false - has_pages = false } test = { homepage_url = "https://effect-ts.github.io/test" + pages = { build_type = "legacy" } } typeclass = { description = "A collection of re-usable typeclasses for the Effect ecosystem" homepage_url = "https://effect-ts.github.io/typeclass" + pages = { build_type = "legacy" } } - vite-plugin-react = { - has_pages = false - } + vite-plugin-react = {} website = { description = "Source code for Effect's documentation website" collaborators = [{ username = "lukaswiesehan", permission = "push" }] homepage_url = "https://www.effect.website" enable_changesets = false - has_pages = false } } diff --git a/terraform/github/variables.tf b/terraform/github/variables.tf index 455bc1542..9461f577e 100644 --- a/terraform/github/variables.tf +++ b/terraform/github/variables.tf @@ -17,12 +17,16 @@ variable "repositories" { visibility = optional(string, "public") is_archived = optional(bool, false) has_discussions = optional(bool, false) - has_pages = optional(bool, true) enable_changesets = optional(bool, true) collaborators = optional(list(object({ username = string, permission = string })), []) + pages = optional(object({ + build_type = string + source_branch = optional(string) + source_path = optional(string) + })) })) } diff --git a/terraform/modules/github_repository/repository.tf b/terraform/modules/github_repository/repository.tf index db5e52b3e..98e18c1db 100644 --- a/terraform/modules/github_repository/repository.tf +++ b/terraform/modules/github_repository/repository.tf @@ -21,13 +21,18 @@ resource "github_repository" "repository" { dynamic "pages" { - for_each = var.has_pages ? [1] : [] + for_each = local.pages != null ? [1] : [] content { - build_type = "legacy" - source { - branch = var.default_branch - path = "/docs" + build_type = local.pages.build_type + + dynamic "source" { + for_each = local.pages.build_type == "legacy" ? [1] : [0] + + content { + branch = local.pages.source_branch + path = local.pages.source_path + } } } } diff --git a/terraform/modules/github_repository/variables.tf b/terraform/modules/github_repository/variables.tf index ec2de0829..d02124783 100644 --- a/terraform/modules/github_repository/variables.tf +++ b/terraform/modules/github_repository/variables.tf @@ -54,12 +54,6 @@ variable "has_issues" { default = true } -variable "has_pages" { - type = bool - description = "Whether or not to enable GitHub pages for the repository." - default = false -} - variable "has_projects" { type = bool description = <<-EOF @@ -83,6 +77,28 @@ variable "collaborators" { default = [] } +variable "pages" { + type = object({ + build_type = string + source_branch = optional(string) + source_path = optional(string) + }) + description = "Attributes associated with the GitHub Pages environment for a repository" + default = null + + validation { + condition = var.pages != null ? contains(["legacy", "workflow"], var.pages.build_type) : true + error_message = "The build type for GitHub pages must be one of: 'legacy', 'workflow'" + } +} +locals { + pages = var.pages == null ? null : { + build_type = var.pages.build_type + source_branch = var.default_branch + source_path = "/docs" + } +} + ################################################################################ # Repository Branch Variables ################################################################################