Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH Pages + GH Actions flow to docs #1590

Closed
MichaelCurrin opened this issue Jul 2, 2021 · 5 comments · Fixed by #1710
Closed

Add GH Pages + GH Actions flow to docs #1590

MichaelCurrin opened this issue Jul 2, 2021 · 5 comments · Fixed by #1710
Labels
A-Documentation Area: Documentation

Comments

@MichaelCurrin
Copy link

There are instructions for GH Pages using Travis

https://rust-lang.github.io/mdBook/continuous-integration.html#deploying-your-book-to-github-pages

But I am a fan of using GH Actions.

I have a workflow in use here which I would be happy to add to the guide.

https://github.com/MichaelCurrin/mdbook-quickstart/blob/main/.github/workflows/main.yml

@MichaelCurrin MichaelCurrin changed the title Extend GH Pages instructions with GH Actions Add GH Pages + GH Actions flow to docs Jul 2, 2021
@ehuss ehuss added the A-Documentation Area: Documentation label Jul 4, 2021
@ISSOtm
Copy link
Contributor

ISSOtm commented Aug 26, 2021

If I may, here is our own workflow for Pan Docs; it's longer, but more "vanilla" (if you remove e.g. the "install Python deps" step, which is specific to our case). It also provides a zip of the pages for archival/debugging purposes.

@MichaelCurrin
Copy link
Author

Thanks for sharing.

That flow is longer and maybe too much for some getting started.

Esp the link checker bit with super long line

My flow uses no Action to handle the install, while your version uses peaceiris/actions-mdbook. With a version parameter that has to be maintained both in workflow and somewhere else for local use.

I don't know if the zip will have use for the typical user. If I ever needed to find output to match the site's current state or an older state, I would run the build command locally, to save having to maintain and uploading step. But your needs might be differen to mine.

@joshxyzhimself
Copy link

joshxyzhimself commented Sep 26, 2021

We got quicker build-times using this workflow (completes in 4 to 8 seconds).

name: Main
 
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]


jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: checkout
        uses: actions/checkout@v2
    
      - name: curl mdbook.tar.gz
        run: curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.12/mdbook-v0.4.12-x86_64-unknown-linux-gnu.tar.gz > ./mdbook.tar.gz

      - name: tar mdbook
        run: tar -zxvf ./mdbook.tar.gz
      
      - name: mdbook build
        run: ./mdbook build

      - name: deploy github pages
        if: ${{ github.event_name != 'pull_request' }}
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: book

@ISSOtm
Copy link
Contributor

ISSOtm commented Sep 28, 2021

(Well, you might want to try piping curl directly into tar instead of saving to a temporary file.)

@tiye
Copy link

tiye commented Dec 16, 2021

Cool with binary! how about lintchecker, is there a similar trick?


~~well, bad luck https://github.com/calcit-lang/guidebook/runs/4550674894?check_suite_focus=true ~~

well, finally made it https://github.com/calcit-lang/guidebook/runs/4550839412?check_suite_focus=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Documentation Area: Documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants