-
Notifications
You must be signed in to change notification settings - Fork 145
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
Build mdbook in CI #71
Conversation
@ctjhoa are you planning on also publishing the mdbook to GitHub pages? Tokio is already doing this so we can just follow their example: https://github.com/tokio-rs/tokio/blob/master/ci/azure-deploy-docs.yml#L20-L38 |
I'm not sure how to proceed as it require a GITHUB_TOKEN which I suppose should be generated by someone from the team. Am I right ? |
I followed those docs and I've added a deploy key to azure pipelines / github! |
c9e9a52
to
f173ab7
Compare
I've done some rewriting but it should be OK now.
|
An alternative on PR could be to run |
This looks good to me, but I also don't really know a ton about what's going on -- did you want to review this PR one last time @rylev?
Last I checked there were issues with using external crates in |
steps: | ||
- template: .ci/install-mdbook.yml | ||
- script: (cd guide && mdbook build) | ||
- job: deploy_book |
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.
why are build and deploy two separate jobs instead of just being steps that happen one after another?
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.
They don't get the same triggers.
On PR we only check if we can build the book.
On changes occurring on master we redeploy the book.
As I said, we could get rid of the first one if it's not useful.
displayName: "Doc - deploy the book" | ||
condition: | | ||
and(not(eq(variables['Build.Reason'], 'PullRequest')), | ||
eq(variables['Build.SourceBranch'], 'refs/heads/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.
You should only need this line and I belive you can get rid of all variables['Build.Reason'], 'PullRequest')
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.
This condition came from this doc:
That condition is a little wild as well. You can read it like a prefix-notation functional language (or an Excel formula, if you prefer): “Run this step only if the variable Build.Reason is NOT ‘PullRequest’ and the variable Build.SourceBranch is ‘master’.”
This is the first step of #64