Skip to content

Commit

Permalink
chore: Deploy storybook automatically, without relying on build artif…
Browse files Browse the repository at this point in the history
…acts in repo (#782)

Co-authored-by: Henning Muszynski <[email protected]>
  • Loading branch information
henningmu and henningmu authored Jun 14, 2023
1 parent 2d1868e commit 39b4b37
Show file tree
Hide file tree
Showing 44 changed files with 53 additions and 966 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feel free to leave unchecked or remove the lines that are not applicable.
- [ ] Executed `npm run validate` and made sure no errors / warnings were shown
- [ ] Described changes in `CHANGELOG.md`
- [ ] Bumped version in `package.json` and `package-lock.json` (`npm --no-git-tag-version version <major|minor|patch>`) [ref](https://docs.npmjs.com/cli/v6/commands/npm-version)
- [ ] Updated all static build artifacts (`npm run build-all`)
- [ ] Reviewed and approved Chromatic visual regression tests in CI

## Versioning
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Storybook to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: npm ci

- name: Build storybook
run: npm run build:storybook

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- run: npm run type-check
- run: npm test

# Verify storybook build and create artifacts for publishing
- run: npm run build-all
# Build artifacts for publishing
- run: npm run build

# Publish to GitHub package registry
- uses: actions/setup-node@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- run: npm run lint
- run: npm run type-check
- run: npm test
- run: npm run build-all
- run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
dist/
es/
lib/
docs/
/styles/
coverage/
.vscode/
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ npm --no-git-tag-version version <major|minor|patch>

[ref](https://docs.npmjs.com/cli/v6/commands/npm-version)

6. Update all static build artifacts:

```sh
npm run build-all
```

Note that the steps above are also documented in the [PR template](.github/PULL_REQUEST_TEMPLATE.md) that you will be prompted with whenever you open a new reactist GitHub PR.

## After merging your changes
Expand All @@ -243,3 +237,5 @@ Once your changes have been merged to `main`, create a new GitHub release:
9. Once the action is complete, check https://npmjs.com/package/@doist/reactist and verify that there's a new public release

Finally, be sure to update both [todoist-web](https://github.com/Doist/todoist-web) and [twist-web](https://github.com/Doist/twist-web) to use the new reactist version you just published.

The storybook hosted on GitHub pages will be automatically updated on each push to `main`. Should there be a problem, try running the action manually from the [Actions settings](https://github.com/Doist/reactist/actions).
2 changes: 0 additions & 2 deletions docs/0.774b85040ddcac8e6134.manager.bundle.js

This file was deleted.

8 changes: 0 additions & 8 deletions docs/0.774b85040ddcac8e6134.manager.bundle.js.LICENSE.txt

This file was deleted.

3 changes: 0 additions & 3 deletions docs/0.8ffbffe3.iframe.bundle.js

This file was deleted.

8 changes: 0 additions & 8 deletions docs/0.8ffbffe3.iframe.bundle.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/0.8ffbffe3.iframe.bundle.js.map

This file was deleted.

1 change: 0 additions & 1 deletion docs/1.2ea4b52e0673a31c7230.manager.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/1.d80c9024.iframe.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/2.0bd2c9d7.iframe.bundle.js

This file was deleted.

2 changes: 0 additions & 2 deletions docs/5.fb81eb8bbf1c7260a5fe.manager.bundle.js

This file was deleted.

31 changes: 0 additions & 31 deletions docs/5.fb81eb8bbf1c7260a5fe.manager.bundle.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/6.97c9cc9361142d6bb8c6.manager.bundle.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/6.a001ea31.iframe.bundle.js

This file was deleted.

31 changes: 0 additions & 31 deletions docs/6.a001ea31.iframe.bundle.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/6.a001ea31.iframe.bundle.js.map

This file was deleted.

Loading

0 comments on commit 39b4b37

Please sign in to comment.