Skip to content

Commit

Permalink
Implements a pipeline to build and publish mllint's GitHub pages website
Browse files Browse the repository at this point in the history
  • Loading branch information
bvobart committed Jul 27, 2021
1 parent b7d80b1 commit 3b6aa93
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish mllint's GitHub Pages website

on:
push:
tags:
- "v*"

jobs:
publish:
name: Build and publish mllint's website to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: ^1.16

- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo theme (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- uses: actions/cache@v2
with:
# In order:
# * Go module download cache
# * Go build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ubuntu-latest-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
ubuntu-latest-go-
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.85.0'
extended: true

- name: Generate Categories & Rules documentation
run: go run ./docs/gh-pages/scripts/generate-docs.go

- name: Build website
run: hugo --minify
env:
HUGO_MLLINT_VERSION: ${GITHUB_REF#refs/tags/v}

- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

0 comments on commit 3b6aa93

Please sign in to comment.