added hugo build action #19
Workflow file for this run
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
name: "Update documentation" | |
on: | |
push: | |
tags: | |
- v* | |
branches: [ "master" ] | |
paths: [ "docs/*", "hack/hugo/*", ".github/workflows/update-doc.yaml" ] | |
pull_request: | |
paths: [ "docs/*", "hack/hugo/*", ".github/workflows/update-doc.yaml" ] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./hack/hugo/hugo-test | |
jobs: | |
hugo: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
sparse-checkout: | | |
hack/ | |
docs/ | |
#- name: Setup Debug Session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# detached: true | |
- | |
name: Build site with Hugo | |
uses: crazy-max/ghaction-hugo@v3 | |
with: | |
version: latest | |
extended: true | |
args: > | |
--config hugo.yaml | |
--buildDrafts | |
--cleanDestinationDir | |
--minify | |
--printPathWarnings | |
--ignoreCache | |
--cleanDestinationDir | |
--noBuildLock | |
--source ${{ env.GITHUB_WORKSPACE }}/hack/hugo/hugo-test" | |
- | |
name: Deploy to GitHub Pages | |
if: github.event_name != 'pull_request' | |
uses: crazy-max/ghaction-github-pages@v4 | |
with: | |
target_branch: gh-pages | |
build_dir: public | |
repo: github.com/fredbi/go-swagger.github.io | |
allow_empty_commit: false | |
jekyll: false | |
verbose: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |