-
Notifications
You must be signed in to change notification settings - Fork 745
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 a GitHub action to publish The Book #877
Conversation
Awesome! I'll get to adding those secrets. Presently we're using the docs from the |
.github/workflows/book.yml
Outdated
- run: mdbook build | ||
working-directory: book | ||
|
||
- uses: jakejarvis/s3-sync-action@master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to pin this to a specific commit instead of master
?
Just in case Jake decides to get nefarious :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You never now with Jake!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
.github/workflows/book.yml
Outdated
with: | ||
args: --follow-symlinks --delete | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh perhaps we could set this to AWS_S3_BOOK_BUCKET
in case we decide to make an action that publishes the cargo docs too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may not have seen it, but we also have this:
https://lighthouse-docs.sigmaprime.io/
It's probably well out of date by now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed the bucket name secret.
As for https://lighthouse-docs.sigmaprime.io/, I think it's redundant. The go to place for code documentation is either crates.io or docs.rs. I think we should publish there by the Principle of Least Astonishment ;) Creating a GitHub v*.*.*
tag seems like a proper trigger for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We unfortunately can't publish on crates.io because we have references to local crates (e.g., some_crate = { path = "../some_crate" }
). We could go and publish everything as a separate crate but that becomes very painful when you're making inter-crate changes (e.g., need to republish or modify the Cargo.toml
to test).
I always assumed that you can only publish on docs.rs if you publish on crates.io.. Perhaps this is a bad assumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a GitHub
v*.*.* tag
seems like a proper trigger for that.
What's this tag? I'm not familiar with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always assumed that you can only publish on docs.rs if you publish on crates.io.. Perhaps this is a bad assumption.
That's a valid assumption despite how my wording might have indicated otherwise ;)
What's this tag? I'm not familiar with it.
Oh that's just a shell-inspired lingo for tags like v0.1.0
, v0.1.1
, etc. GitHub Actions support such wildcards: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
We unfortunately can't publish on crates.io because we have references to local crates (e.g., some_crate = { path = "../some_crate" }). We could go and publish everything as a separate crate but that becomes very painful when you're making inter-crate changes (e.g., need to republish or modify the Cargo.toml to test).
Didn't realize that. In that case, a link to https://lighthouse-docs.sigmaprime.io/ on the crates.io page should do. I've created an issue for publishing code docs: #897. Feel free to prioritize it in the 'Security Review' project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize that. In that case, a link to https://lighthouse-docs.sigmaprime.io/ on the crates.io page should do.
I might be misunderstanding, but we can't even have a crates.io page for Lighthouse. cargo publish
will always fail due to those path-based crate links :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Looks like it worked here! https://github.com/sigp/lighthouse/runs/489004938?check_suite_focus=true I can't see the changes on the web yet, but perhaps it's a caching thing. EDIT: it just updated, yay! |
Issue Addressed
The Lighthouse Book is currently out of date.
Resolves #546
Proposed Changes
Add an GitHub action that builds and uploads (to S3) the latest version on every merge to
master
.Additional Info
This PR has been shown to successfully build and upload (with hook branch set to
update-book
temporarily) http://adam-lighthouse-book-dev.s3-website-ap-southeast-2.amazonaws.com/: https://github.com/adaszko/lighthouse/runs/472525745?check_suite_focus=trueHopefully, you're able to view the links above.
The plan for merging:
AWS_S3_BUCKET
(it should be set to the S3 bucket name behind https://lighthouse-book.sigmaprime.io/)AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
master
triggers a successfulmdbook / build-and-upload-to-s3
job