-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements a pipeline to build and publish mllint's GitHub pages website
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
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 |