Skip to content

Deployment on GitHub Pages with Workflow action fails #1975

@benjaminpope

Description

@benjaminpope

Environment

  • Version of Docsy you are using: v0.9.2-0.20240423183652-ec13ca8f7f8a
  • How are you using Docsy? As a:
    • Hugo module
  • Version of Hugo you are using (output of hugo version): hugo v0.125.4+extended darwin/arm64 BuildDate=2024-04-25T13:27:26Z VendorInfo=brew

Problem

I am trying to deploy this website, which is a clone of the example site, to GitHub Pages using the officially recommended hugo.yaml workflow. I have added the following lines to the workflow to try and match the instructions:

    steps:
      - name: install npm
        run: |
          npm install --save-dev autoprefixer
          npm install --save-dev postcss-cli
          npm install -D postcss

hugo server builds locally just fine on my M1 MacBook Pro, but when I push to GitHub I get the following error in the workflow:

hugo: downloading modules …
hugo: collected modules in 11142 ms
Start building sites … 
hugo v0.125.4-cc3574ef4f41fccbe88d9443ed066eb10867ada2+extended linux/amd64 BuildDate=2024-04-25T13:27:26Z VendorInfo=gohugoio
Total in 14208 ms
Error: error building site: POSTCSS: failed to transform "/scss/main.css" (text/css). Check your PostCSS installation; install with "npm install postcss-cli". See https://gohugo.io/hugo-pipes/postcss/: binary with name "npx" not found
Error: Process completed with exit code 1.

If I downgrade to v0.9.1 and try again, I get a different error

hugo: downloading modules …
hugo: collected modules in 22735 ms
Start building sites … 
hugo v0.125.4-cc3574ef4f41fccbe88d9443ed066eb10867ada2+extended linux/amd64 BuildDate=2024-04-25T13:27:26Z VendorInfo=gohugoio
ERROR render of "home" failed: "/tmp/hugo_cache_runner/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.9.1/layouts/_default/baseof.html:4:7": execute of template failed: template: home.html:4:7: executing "home.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:53:[16](https://github.com/aew10/website/actions/runs/8908963883/job/24465502306#step:8:17): no such template "_internal/google_analytics_async.html"
ERROR render of "section" failed: "/tmp/hugo_cache_runner/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.9.1/layouts/_default/baseof.html:4:7": execute of template failed: template: _default/list.html:4:7: executing "_default/list.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:53:16: no such template "_internal/google_analytics_async.html"
Total in 22793 ms
Error: error building site: render: failed to render pages: render of "404" failed: "/tmp/hugo_cache_runner/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.9.1/layouts/_default/baseof.html:4:7": execute of template failed: template: 404.html:4:7: executing "404.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:53:16: no such template "_internal/google_analytics_async.html"

What is going on? Is there a workflow that anyone has that will just work for a GitHub Action?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions