Skip to content

gwatts/go-docs-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Go Docs Action

This action uses godoc-static to generate a static HTML copy of a repos Go source documentation.

It will place the HTML output into a temporary directory and return the directory name in a step output, which can be used by subsequent workflow steps to upload the documentation and make it accessible.

Example Workflow

name: Go Docs
on: 
  push:
  pull_request:

jobs:
  godocs:
    - uses: actions/checkout@v3
    - uses: actions/setup-go@v3
    - uses: actions/cache@v2
      with:
        path: |
          ~/.cache/go-build
          ~/go/pkg/mod
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: |
          ${{ runner.os }}-go-

    - name: generate godocs
      id: godocs
      uses: gwatts/go-docs-action@v1
      with:
        title: 'My Project'
        description: 'Docs for branch ${{ github.ref.name }}'
    
    - name: upload docs to s3
      run: aws s3 sync --delete --only-show-errors ${{ steps.godocs.outputs.output-path }}/ s3://my-bucket/prefix/

About

Generate static HTML documentation of Go source code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •