Skip to main content

ephemeris_forge_github/config/
pages.rs

1use facet::Facet;
2
3/// How a Pages site is built.
4#[derive(Clone, Copy, Debug, Eq, Facet, PartialEq)]
5#[repr(u8)]
6pub enum BuildType {
7    /// GitHub builds the site from a branch.
8    #[facet(rename = "legacy")]
9    Legacy,
10    /// A GitHub Actions workflow deploys the site.
11    #[facet(rename = "workflow")]
12    Workflow,
13}
14
15/// The folder of the source branch that a legacy site publishes.
16#[derive(Clone, Copy, Debug, Eq, Facet, PartialEq)]
17#[repr(u8)]
18pub enum SourcePath {
19    /// The repository root.
20    #[facet(rename = "/")]
21    Root,
22    /// The `docs` folder.
23    #[facet(rename = "/docs")]
24    Docs,
25}
26
27/// The branch and folder a legacy site publishes.
28#[derive(Clone, Debug, Eq, Facet, PartialEq)]
29#[facet(deny_unknown_fields)]
30pub struct Source {
31    /// The branch to publish.
32    pub branch: String,
33    /// The folder of the branch to publish.
34    pub path: SourcePath,
35}
36
37/// Desired Pages site of a repository.
38#[derive(Clone, Debug, Eq, Facet, PartialEq)]
39#[facet(deny_unknown_fields)]
40pub struct Pages {
41    /// Whether the site exists. When false, ephemeris deletes the site.
42    pub enabled: bool,
43    /// How the site is built.
44    pub build_type: BuildType,
45    /// The published branch and folder, used by legacy builds.
46    pub source: Source,
47    /// The custom domain. Null means no custom domain.
48    pub cname: Option<String>,
49    /// Whether HTTPS is required.
50    pub https_enforced: bool,
51}