Skip to content

Commit

Permalink
pages: use official action
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlettman committed Jul 16, 2024
1 parent d02b6e6 commit 4448504
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ on:
- "**/*.md"
- "**/*.py"
- "LICENSE"
workflow_dispatch:
inputs:
head:
description: "Git commit to publish documentation for."
required: true
type: string

jobs:
docs:
build:
name: Build documentation
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -22,20 +29,38 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build documentation
cache: true
- name: Generate documentation
run: |
go install go.abhg.dev/doc2go@latest
doc2go -out docs ./...
- name: Deploy documentation to GitHub pages
if: github.ref == 'refs/heads/devel'
uses: peaceiris/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./docs
COMMIT_MESSAGE: "Pages: ${{ github.event.head_commit.message }}"
- name: Upload documentation
uses: actions/upload-artifact@v1
with:
name: documentation
path: docs
path: docs
- name: Upload pages
if: github.ref == 'refs/heads/devel'
uses: actions/upload-pages-artifact@v1
with:
path: docs

publish:
name: Publish pages website
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub pages
if: github.ref == 'refs/heads/devel'
id: deployment
uses: actions/deploy-pages@v1

0 comments on commit 4448504

Please sign in to comment.