Skip to content

Commit

Permalink
test dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaeltm committed Mar 21, 2024
1 parent 04fef1d commit 002db9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,12 @@ jobs:
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
MACOS_NOTARIZATION_APP_PW: ${{ secrets.MACOS_NOTARIZATION_APP_PW }}

# an action that will ping another repo to trigger a docs build
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PAT }}
repository: defang-io/defang-docs
event-type: test-deploy

17 changes: 9 additions & 8 deletions src/cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,6 @@ var tosCmd = &cobra.Command{
}

func main() {

if len(os.Args) > 1 && os.Args[1] == "gen-docs" {
gen_docs()
return
}
defangFabric := pkg.Getenv("DEFANG_FABRIC", cli.DefaultCluster)
defangProvider := cliClient.Provider(pkg.Getenv("DEFANG_PROVIDER", "auto"))

Expand Down Expand Up @@ -956,6 +951,11 @@ func main() {
}

flushAllTracking()

if len(os.Args) > 2 && os.Args[1] == "gen-docs" && os.Args[2] != "" {
gen_docs(os.Args[2])
return
}
}

func prettyExecutable(def string) string {
Expand Down Expand Up @@ -1003,9 +1003,10 @@ func printDefangHint(hint, args string) {
}
}

func gen_docs() {
// Assume 'rootCmd' is the root of your command tree
err := doc.GenMarkdownTree(rootCmd, "./docs")
func gen_docs(docsPath string) {
_ = os.Mkdir(docsPath, 0755)

err := doc.GenMarkdownTree(rootCmd, docsPath)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 002db9e

Please sign in to comment.