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 }} +``` +