From e3045c5fb50cfbacbc0d9b9ce287d7e112f56e00 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Sun, 24 May 2020 12:09:28 +0900 Subject: [PATCH] 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 --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cf4ce2..5c31f85 100644 --- a/README.md +++ b/README.md @@ -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 }} +``` +