-
Notifications
You must be signed in to change notification settings - Fork 47
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 docs using GitHub Actions #963
Conversation
Demo starting at https://react-components-963.demos.haus |
@@ -23,3 +23,28 @@ jobs: | |||
- run: npm publish --access public | |||
env: | |||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |||
build-docs: |
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 largely the same as the example: https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages#linking-separate-build-and-deploy-jobs.
Once this lands we'll need to change the setting to use the action to build the docs instead of using the current build files. |
@@ -23,3 +23,28 @@ jobs: | |||
- run: npm publish --access public | |||
env: | |||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |||
build-docs: |
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 would add needs: publish-npm
to make sure we don't update the docs if npm publish fails for any reason.
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.
Good thinking, I've updated that.
As this affects the release process there are some docs that may need updating. Like: https://github.com/canonical/react-components/blob/main/PUBLISH-NPM-PACKAGE.md Also the "prepare-release" script mentioned there is built to automate the I guess once we land this, the whole "Prepare release" PR would be reduced to changing version number, which in practice we could move into individual PRs that do the change (as in Vanilla), to remove the need of "Prepare release" PR completely. Anyway, I'd suggest at least slightly updating the https://github.com/canonical/react-components/blob/main/PUBLISH-NPM-PACKAGE.md docs, to mention the changes, and maybe mention somewhere that docs are built automatically by GH action. I also wonder if there is still a way to manually build the docs in case we need it outside of the release process. |
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.
Looks good. I'd just add the dependency between docs job and publish to npm job as mentioned in inline comment, and possibly adjust the docs.
These docs didn't actually mention building the docs or automatically publishing to NPM, so I've added details about both of them.
In this PR I removed the docs building from
I think that's a good idea.
Done and done.
Yes! You can configure an action to allow it to be manually run. I've done this and added a section to the docs. |
86110bc
to
35ce6a1
Compare
Done
Fixes
Fixes: #944.