Skip to content
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

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

huwshimi
Copy link
Collaborator

Done

  • Remove docs build files from the repository.
  • Set up GitHub Actions to publish the docs on release.

Fixes

Fixes: #944.

@webteam-app
Copy link

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:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huwshimi
Copy link
Collaborator Author

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:
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@bartaz
Copy link
Contributor

bartaz commented Aug 30, 2023

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 build-docs step, which is not needed. So the script may need updating (or removing completely).

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.

Copy link
Contributor

@bartaz bartaz left a 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.

@huwshimi
Copy link
Collaborator Author

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

These docs didn't actually mention building the docs or automatically publishing to NPM, so I've added details about both of them.

Also the "prepare-release" script mentioned there is built to automate the build-docs step, which is not needed. So the script may need updating (or removing completely).

In this PR I removed the docs building from prepare-release but left the script to update the version, but I think just updating the version might be less confusing than running the script. I've updated the docs to reflect this and removed the prepare-release script.

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.

I think that's a good idea.

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.

Done and done.

I also wonder if there is still a way to manually build the docs in case we need it outside of the release process.

Yes! You can configure an action to allow it to be manually run. I've done this and added a section to the docs.

@huwshimi huwshimi merged commit c4b8cd6 into canonical:main Aug 31, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move docs out of main
3 participants