Skip to content

Commit

Permalink
Separate doc-gen from general build
Browse files Browse the repository at this point in the history
If working on a fork you maybe do not want (or cannot) publish
documentation. By putting that in a separate workflow it is easy to
disable or remove that workflow

Signed-off-by: Erik Jaegervall <[email protected]>
  • Loading branch information
erikbosch committed Oct 14, 2024
1 parent c6e2ea8 commit 322956e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install vss-tools dependencies
run: |
Expand Down Expand Up @@ -78,23 +76,3 @@ jobs:
- name: Test optional targets. NOTE - always succeeds
run: |
make -k optional_targets || true
- name: Install hugo
env:
HUGO_VER : 0.129.0
run: |
curl -LO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VER}/hugo_${HUGO_VER}_linux-amd64.deb
sudo dpkg -i hugo_${HUGO_VER}_linux-amd64.deb
- name: Make docs
run: |
hugo -s ./docs-gen
- name: Deploy docs
# Only deploy docs if this was a push to master
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
commit-message: Auto-deploy docs built from commit ${{ github.sha }}
37 changes: 37 additions & 0 deletions .github/workflows/docgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Documentation Generation

on:
push:
pull_request:
workflow_dispatch:
workflow_call:

jobs:
docgen:
name: Generate and Deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install hugo
env:
HUGO_VER : 0.129.0
run: |
curl -LO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VER}/hugo_${HUGO_VER}_linux-amd64.deb
sudo dpkg -i hugo_${HUGO_VER}_linux-amd64.deb
- name: Make docs
run: |
hugo -s ./docs-gen
- name: Deploy docs
# Only deploy docs if this was a push to master
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
commit-message: Auto-deploy docs built from commit ${{ github.sha }}

0 comments on commit 322956e

Please sign in to comment.