-
Notifications
You must be signed in to change notification settings - Fork 89
Refactor documentation deploy #1165
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1165 +/- ##
=======================================
Coverage 92.70% 92.70%
=======================================
Files 158 158
Lines 16158 16158
=======================================
Hits 14979 14979
Misses 1179 1179 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
@ericpre i hadn't thought about someone modifying the make file. That is a really good catch. Do we want to add this in the hyperspy/.github shared workflows? |
fa76f62 to
9669199
Compare
|
Yes, I will add some documentation. |
|
Done in hyperspy/.github@3d6506b. I have also set the permissions to be downgraded in the build stage to be on the safe side - see notes from https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#supported-keywords-for-jobs-that-call-a-reusable-workflow on passing permission from caller to called workflow. |
CSSFrancis
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.
Just a couple of comments
.github/workflows/docs-deploy.yml
Outdated
|
|
||
| - name: Deploy versioned docs | ||
| # run on tag only | ||
| if: github.ref_type == 'tag' |
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 should be on a tag or a workflow dispatch.
Just if we make a new release and the documentation build fails then the idea is that we can just run the workflow dispatch to build a new version of the docs. That and we can overwrite a version if necessary.
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 don't think that it is necessary to specify a tag (this was actually a comment that I had when reviewing #1164) because I expect that it will work as follow:
- select a tag from the "Run workflow" menu - see screenshot below
github.ref_typeshould betagand therefore the condition for that step true.
Maybe something to add the documentation?
Of course, this is not to say that they may some teething issue with this refactor, but this is the idea!
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.
Ahhh that's interesting... I guess I'm learning a lot about GitHub workflows :)
…s (dev, pr-preview and tag) in the same workflow
9669199 to
6a84d74
Compare
|
I have checked the workflow by pushing on main in my fork. With the fixes in 4fe4229 and f50064f, it is working:
I haven't checked yet if this works as expected when running the workflow manually from a tag. |
|
@ericpre Sounds great! Do you want me to merge this to see if the preview deploy still works? |
|
I had another look and I don't think that using This could still be possible using different actions, such as for example in wpaccessibility/wp-a11y-docs#136. What do you think? |
Seems sensible to me :) It's just pushing to a different repo so there isn't anything that says it has to specifically be an action designed for a PR-preview. |
f50064f to
538a35e
Compare
|
I have tried a different approach using |
|
@ericpre i would just do like you suggested and switch to the JamesIves/github-pages-deploy-action@v4 In that case we can just get the PR number and push to the right branch. Basically following this: https://github.com/wpaccessibility/wp-a11y-docs/pull/136/files |
|
Let me know if you want me to try that tomorrow. |
330fe75 to
8c04180
Compare
|
I thought that I would give a go at keeping the cleanup steps out of the deploy workflow itself but adding the customised action is indeed a bit messy! This PR now has the clean up steps in the deploy workflow. Here is my security vulnerability assessment of the deploy workflow:
|
…review in the workflow dispatch
8c04180 to
8b05576
Compare
CSSFrancis
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.
@ericpre This looks great!
@CSSFrancis, I tried to restructure to simplify and separate the build and push steps in two separate workflow. This approach is inspired from https://securitylab.github.com/resources/github-actions-preventing-pwn-requests.
pushorpull_requestevents and doesn't have write permission to the repositoryworkflow_dispatchevent for the deploy workflow, and trigger it at the end of the build workflow.