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

CI: Refactor workflow file to build and publish Documentation website and Storybook simultaneously #1258

Merged
merged 15 commits into from
Sep 23, 2024

Conversation

drikusroor
Copy link
Contributor

@drikusroor drikusroor commented Sep 10, 2024

This pull request refactors the workflow file to build and publish both the documentation and Storybook simultaneously.

Instead of directly artifacting and deploying the frontend/storybook-static directory, the workflow is now configured to create and use the docs-pages directory in the root of the repository which gets published to Github Pages. Storybook is then configured to publish its build into docs-pages/storybook and update its internal links (config.base) to be prefixed with /MUSCLE/storybook/ (MUSCLE is this repository's Github Pages' path, storybook is the subdirectory of storybook)

I've created a dummy index.html with a link to the Storybook site that shows that it works: https://amsterdam-music-lab.github.io/MUSCLE. This should probably removed when the Documentation website is integrated into this workflow. So, remove these lines:

- name: Create main index.html
run: |
mkdir -p docs-pages
echo '<html><head><title>Project Documentation</title></head><body><h1>Project Documentation</h1><ul><li><a href="/MUSCLE/storybook">Storybook</a></li></ul></body></html>' > ./docs-pages/index.html

New directory / file structure for Github Pages

(root)
  - frontend
  - backend
  - docs-pages (this directory will be published to Github Pages and should serve as the root of the built documentation website made by Evert)
    - index.html (index.html from Documentation website)
    - storybook
      - index.html (of storybook)

Important to know:

Currently, the workflow is configured to deploy for this branch too (besides develop) in order to test the updated workflow.

See the commented out condition for refs/heads/develop here:

deploy-gh-pages:
# only deploy on develop branch
# temporarily turn off for testing
# if: github.ref == 'refs/heads/develop'

If I'm on vacation and @Evert-R wants to test the Documentation website being deployed to Github Pages correctly, it's probably a good idea to leave this turned on until we can verify it works as expected. BUT, Github Pages doesn't just publish from every git branch as there is a protection layer. So if you are trying to test your branch to be deployed correctly, you have to add your branch here (Settings > Environments > github-pages > Deployment tags & branches): https://github.com/Amsterdam-Music-Lab/MUSCLE/settings/environments/1801563345/edit

@drikusroor drikusroor self-assigned this Sep 10, 2024
@drikusroor drikusroor marked this pull request as ready for review September 10, 2024 08:38
@drikusroor drikusroor changed the title CI: Refactor workflow file to build and publish docs and Storybook simultaneously CI: Refactor workflow file to build and publish Documentation website and Storybook simultaneously Sep 10, 2024
@drikusroor drikusroor added documentation Improvements or additions to documentation Infrastructure Relates to deployment or testing labels Sep 10, 2024
Copy link
Collaborator

@BeritJanssen BeritJanssen left a comment

Choose a reason for hiding this comment

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

LGTM

@drikusroor drikusroor force-pushed the docs/deploy-api-docs-storybook-pages branch from 2b7156d to 3d004b3 Compare September 23, 2024 09:06
@drikusroor drikusroor merged commit 85f2743 into develop Sep 23, 2024
8 checks passed
@drikusroor drikusroor deleted the docs/deploy-api-docs-storybook-pages branch September 23, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Infrastructure Relates to deployment or testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants