just-the-docs / just-the-docs-template

one-click template to use just-the-docs on GitHub Pages
https://just-the-docs.github.io/just-the-docs-template/
MIT License
128 stars 109 forks source link

Github action for just-the-docs site in docs/ sub-directory #37

Closed ABRG-Models closed 10 months ago

ABRG-Models commented 10 months ago

Hi I'm following 'Modify the GitHub Actions workflow' in

https://github.com/just-the-docs/just-the-docs-template/blob/main/README.md

I get this error:

https://github.com/ABRG-Models/morphologica/actions/runs/7286458464/job/19855212486

(not sure if this is public)

Run actions/jekyll-build-pages@v1
/usr/bin/docker run --name ghcrioactionsjekyllbuildpagesv109_b5117d --label 4107db --workdir /github/workspace --rm -e "GITHUB_PAGES" -e "INPUT_SOURCE" -e "INPUT_DESTINATION" -e "INPUT_FUTURE" -e "INPUT_BUILD_REVISION" -e "INPUT_VERBOSE" -e "INPUT_TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/morphologica/morphologica":"/github/workspace" ghcr.io/actions/jekyll-build-pages:v1.0.9
Configuration file: none
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
             Error: could not read file /github/workspace/docs/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.3/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'docs/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.3/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'docs/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.3/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
Error:  Logging at level: debug GitHub Pages: github-pages v228 GitHub Pages: jekyll v3.9.3 Theme: jekyll-theme-primer Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0 Requiring: jekyll-github-metadata Requiring: jekyll-seo-tag Requiring: jekyll-coffeescript Requiring: jekyll-commonmark-ghpages Requiring: jekyll-gist Requiring: jekyll-github-metadata Requiring: jekyll-paginate Requiring: jekyll-relative-links Requiring: jekyll-optional-front-matter Requiring: jekyll-readme-index Requiring: jekyll-default-layout Requiring: jekyll-titles-from-headings GitHub Metadata: Initializing... Source: /github/workspace/./ Destination: /github/workspace/./_site Incremental build: disabled. Enable with --incremental Generating... Reading: docs/_posts/2023-11-18-A_Post.md Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2014-05-11-exclude-this-post.md Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2016-04-02-错误.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2015-01-18-jekyll-last-modified-at.md Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2013-12-12-dec-the-second.md Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2014-03-04-march-the-fourth.md Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2014-03-02-march-the-second.md Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2016-04-03-错误.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-sitemap-1.4.0/spec/fixtures/_posts/2016-04-01-错误.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-paginate-1.1.0/spec/source/_posts/2014-05-20-blah.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-paginate-1.1.0/spec/source/_posts/2014-05-24-whateva.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-paginate-1.1.0/spec/source/_posts/2014-05-22-humor.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-paginate-1.1.0/spec/source/_posts/2014-05-25-oh-yes.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-paginate-1.1.0/spec/source/_posts/2014-05-23-hey-there.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-paginate-1.1.0/spec/source/_posts/2014-05-21-bleh.html Reading: docs/vendor/bundle/ruby/3.1.0/gems/jekyll-3.9.3/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb

My action yml is:

https://github.com/ABRG-Models/morphologica/blob/9b703edbffdf4393442fb854dbcc8252a3dcf43e/.github/workflows/jekyll-gh-pages.yml

I want to build a site from files in docs/ in my existing code repo 'morphologica'

Any idea how to fix?

ABRG-Models commented 10 months ago

Update: I changed the action .yml file, copying it from a newly created template using this just-the-docs-template. It now looks like this:

https://github.com/ABRG-Models/morphologica/actions/runs/7287086163/workflow

With an error about the url:

https://github.com/ABRG-Models/morphologica/actions/runs/7287086163/job/19857021708

ABRG-Models commented 10 months ago

I added a url to the _config.yml and it works. Excellent.

mattxwang commented 10 months ago

Glad you've figured it out!

(any suggestions on places we could improve our docs?)