Skip to content

Commit

Permalink
[ADD] generate docs on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eijei521 committed Aug 10, 2022
1 parent ec63ba2 commit 5b716c0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'ci'

on:
push:
branches:
- main
pull_request:

jobs:
docs:
name: docs
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.17' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Restore Cache
uses: actions/cache@v3
id: cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Build docs
run: make generate-docs
- name: Detect Uncommitted Docs
run: git diff --exit-code docs
2 changes: 0 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ builds:
binary: cherryctl
ldflags:
- -X github.com/cherryservers/cherryctl/cmd.Version={{.Version}}
- -X github.com/cherryservers/cherryctl/cmd.Build=${.Commit}"

goos:
- linux
- windows
Expand Down
7 changes: 5 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ import (
"github.com/spf13/cobra"
)

var (
Version string = "dev"
)

const (
apiTokenEnvVar = "CHERRY_AUTH_TOKEN"
apiURL = "https://api.cherryservers.com/v1/"
version = "dev"
)

type Cli struct {
Expand All @@ -40,7 +43,7 @@ func NewCli() *Cli {
Outputer: &outputs.Standard{},
}

rootClient := root.NewClient(os.Getenv(apiTokenEnvVar), apiURL, version)
rootClient := root.NewClient(os.Getenv(apiTokenEnvVar), apiURL, Version)
rootCmd := rootClient.NewCommand()
rootCmd.DisableSuggestions = false
cli.MainCmd = rootCmd
Expand Down

0 comments on commit 5b716c0

Please sign in to comment.