ggen_cli_lib/cmds/ci/
mod.rs

1use clap::{Args, Subcommand};
2use ggen_utils::error::Result;
3
4// Declare verb modules
5pub mod pages;
6pub mod release;
7pub mod trigger;
8pub mod workflow;
9
10#[derive(Args, Debug)]
11pub struct CiCmd {
12    #[command(subcommand)]
13    pub verb: Verb,
14}
15
16#[derive(Subcommand, Debug)]
17pub enum Verb {
18    /// Manage GitHub Pages deployment
19    Pages(pages::PagesArgs),
20
21    /// Run release workflows locally with act
22    Release(release::ReleaseArgs),
23
24    /// Manage GitHub Actions workflows
25    Workflow(workflow::WorkflowArgs),
26
27    /// Trigger CI/CD workflows manually
28    Trigger(trigger::TriggerArgs),
29}
30
31impl CiCmd {
32    pub async fn run(&self) -> Result<()> {
33        match &self.verb {
34            Verb::Pages(args) => pages::run(args).await,
35            Verb::Release(args) => release::run(args).await,
36            Verb::Workflow(args) => workflow::run(args).await,
37            Verb::Trigger(args) => trigger::run(args).await,
38        }
39    }
40}