-
Notifications
You must be signed in to change notification settings - Fork 18
CI: consolidate docs deployment workflows and add PR previews #123
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
base: master
Are you sure you want to change the base?
CI: consolidate docs deployment workflows and add PR previews #123
Conversation
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
dlebauer
left a comment
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.
@AritraDey-Dev thanks for taking on this task, pr-previews will be a useful feature! I have updated the repository settings as indicated.
One change needed - right now the PR preview runs for all PRs, including forks, but the job fails because the action doesn't have permissions to push from the fork.
Please one of the following:
- (quickest, no previews from forks) don't allow builds on PRs from forks. This isn't ideal, but changing line 38 to
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repositorymight work - to enable previews from forks we could use a two-step process
- pull_request workflow just builds sites and uploads it as an artifact
- a separate script that can be triggered by a maintainer (
workflow_dispatch) downloads the artifact and deploys it to a dedicated branch usingGITHUB_TOKEN
- There may be other and possibly better ways to achieve the pr-previews.
59d5621 to
797e90c
Compare
Signed-off-by: Aritra Dey <[email protected]>
797e90c to
9b6dd7a
Compare
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
a5786b5 to
1e812af
Compare
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
Signed-off-by: Aritra Dey <[email protected]>
cc4197e to
4562db8
Compare
| "Ecosystem science, policy, and management informed by the best available data and models", | ||
| url: "https://pecanproject.github.io", | ||
| baseUrl: "/", | ||
| baseUrl: process.env.BASE_URL || "/", |
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.
how does this change help with our current changes ?
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.
It's required for a PR preview for the Docusaurus config. Actually, I was trying to deploy to gh pages using this workflow for a PR in my fork (just to test) , but in every case, the deployed URL was returning 404.
Then I found this fix in Docusaurus config here which fixes 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.
Also For this PR, I was looking for a similar way to comment the PR preview automatically, very similar to what Netlify does. Unfortunately, that is only supported by GitHub Pages and GitHub Actions. So, we need to follow a two-step process for the preview, as @dlebauer mentioned in the 2nd option here. It seems like this is the only way to create a preview website for a PR.
Signed-off-by: Aritra Dey <[email protected]>
|
@AritraDey-Dev let me know once you get this PR ready for review |
This PR consolidates docs deployment into a single workflow with automatic PR previews and Github pages deployment.
Fixes #121
/cc @dlebauer
To pass the CI check need to follow step 4 mentioned in the issue i.e.