peaceiris / actions-mdbook

GitHub Actions for mdBook (rust-lang/mdBook) ⚡️ Setup mdBook quickly and build your site fast. Linux (Ubuntu), macOS, and Windows are supported.

Home Page:https://github.com/marketplace/actions/mdbook-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

proposal: Build the book somewhere other than root directory

yngtodd opened this issue · comments

Thank you for putting together this action!

Is your feature request related to a problem? Please describe.
I am having a bit of difficulty when building somewhere other than the root of the project. The book will build, but I am getting a 404 error when I go to the pages site.

Describe the solution you'd like
I am experimenting with using mdbook for the documentation of my Python projects. With that, I would like to keep with Python conventions to have my docs stored in project_root/docs. I set my actions yml file to use the following:

# ...
      - run: cd docs && mdbook build && cd ..

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs/book

Here is a link to my gh-pages.yml.

Describe alternatives you've considered
I could keep everything in the project root, but it may be confusing for users to find the markdown files for the docs.

Additional context
I might be missing a final step in the process. My GitHub settings page shows that the book is being hosted at pages site. Not sure why I am getting a 404 error.

You just forget to enable GitHub Pages.

README - peaceiris/actions-gh-pages

Notes: Actually, the GITHUB_TOKEN works for deploying to GitHub Pages but it has still some limitations. For the first deployment, we need to select the gh-pages branch or master branch on the repository settings tab. See First Deployment with GITHUB_TOKEN

First Deployment with GITHUB_TOKEN - peaceiris/actions-gh-pages

That's odd, I had selected gh-pages branch in Settings. That then gave me the link shown in the screenshot below, saying that site was ready to be published. However, following that link gives me the 404 error.

Screen Shot 2020-04-21 at 12 30 19 AM

Ah, thanks for your help. Triggering another build fixed the issue for me! Thanks again for putting this together!