Skip to content

Commit

Permalink
ci(actions): add doc deployment action
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Oct 2, 2023
1 parent ae6e1d7 commit 5f8e44c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/docs.yml
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

0 comments on commit 5f8e44c

Please sign in to comment.