-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(actions): add doc deployment action
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: deploy docs | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true # Fetch Hugo themes (true OR recursive) | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
- name: Setup Golang env | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
- name: Generate CLI docs | ||
run: go run main.go gen doc -d docs/content/en/docs/more/cli | ||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.119.0' | ||
extended: true | ||
|
||
- name: Build | ||
run: | | ||
cd docs | ||
hugo --minify | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/public |