-
Notifications
You must be signed in to change notification settings - Fork 100
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
Set up GitHub Actions to automatically build gitbook #7
Comments
If you're still interested in pursuing this, I've got it working for the rusoto GitBook: https://github.com/rusoto/rusoto.github.io. I believe you'll need to do the following:
BTW thanks for making a serde GitBook! I've used the layout as the basis for ours :) |
Recently, I was facing same problem. |
Hello, I looked into this, and it seems simple enough (using actions instead of travis). However, i'm quite confused when it comes to the structure of this repo. How is the book regenerated? Currently i'm using |
Here is what I run in the repo root to regenerate: $ gitbook build && rm -rf gitbook styles && mv _book/* . This is with these version of gitbook locally, which might be old. If a newer gitbook is generating different html then it's probably fine to use the new one. $ gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3 Line 10 in 40f70d8
|
I see. 3.2.3 is the exact version the workflow is using. There's a slight problem, though, gitbook seems to make changes based on the time whenever you run That sucks, it would mean a new commit whenever this workflow runs. Is there a way to prevent this? |
We could run a It may be worth looking into how this timestamp gets used from the gitbook codebase; if it's totally superfluous they may accept a PR with a configuration option to disable it. Alternatively I think gitbook's plugin system has an html postprocessing step so we could write a plugin that strips it. |
yikes. i will have a look, but seeing how gitbook (at least the version we're using) is in maintenance mode, it might be worth to just do #17 instead... Edit: Looking at the git history, we might just take that. most commits are changes to the book anyways. |
I'm not exactly proud of it, but here's one solution: gitbook build
rm -rf gitbook styles
mv _book/* .
git restore gitbook/gitbook-plugin-lunr/search-lunr.js # don't revert https://github.com/serde-rs/serde-rs.github.io/commit/1fd8104d5a16256279831dc90cb8f7a61b26ec58
if ! git diff -U0 ':!search_index.json' | grep -P '^[+-](?!\+\+)(?!--)' | grep -v -P '[+-]\s+gitbook\.page\.hasChanged'; then # Check if we have any diff *other* than search_index.json and lines starting with gitbook.page.hasChanged (which are just metadata)
echo No content changes, resetting to prevent a commit
git reset --hard
fi Tests: Commit without content changes aborts. |
Currently I need to update both the markdown source and the generated html. I should be able to push changes to markdown and have GitHub Actions push a commit containing built html.
The text was updated successfully, but these errors were encountered: