docs: Add new section for google/docsy

An example workflow for autoprefixer, postcss-cli,
and a Hugo theme which has recursive Git submodules

https://github.com/peaceiris/actions-hugo/issues/340
https://github.com/google/docsy-example/issues/60
This commit is contained in:
peaceiris 2020-05-24 12:09:28 +09:00
parent 8f166cf07e
commit e3045c5fb5
No known key found for this signature in database
GPG Key ID: 5868468A8EBA64EC
1 changed files with 55 additions and 1 deletions

View File

@ -82,7 +82,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
@ -192,6 +192,60 @@ The alpine base Hugo Docker image is provided on the following repository.
> [peaceiris/hugo-extended-docker: Hugo alpine base Docker image (Hugo extended and Hugo Modules)](https://github.com/peaceiris/hugo-extended-docker)
### ⭐️ Workflow for autoprefixer and postcss-cli
Here is an example workflow for the [google/docsy] Hugo theme.
This theme needs `autoprefixer` and `postcss-cli` to build a project.
The following workflow is tested on [google/docsy-example].
[google/docsy]: https://github.com/google/docsy
[google/docsy-example]: https://github.com/google/docsy-example
```yaml
name: github pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive # Fetch the Docsy theme
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.71.0'
extended: true
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
<div align="right">
<a href="#table-of-contents">Back to TOC ☝️</a>
</div>