1- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3-
41name : Publish
52
63on :
96 types : [published]
107
118permissions :
12- contents : read
9+ contents : write # Needed to push to gh-pages
1310 pages : write
1411 id-token : write
1512
1613jobs :
1714 publish :
1815 runs-on : ubuntu-latest
16+
1917 steps :
2018 - name : Checkout repository
2119 uses : actions/checkout@v4
@@ -32,35 +30,27 @@ jobs:
3230 uses : actions/setup-node@v4
3331 with :
3432 node-version : 20
35- cache : ' pnpm'
33+ cache : " pnpm"
34+ cache-dependency-path : pnpm-lock.yaml
3635
37- - name : Get pnpm store directory
38- shell : bash
39- run : |
40- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
36+ - name : Install dependencies
37+ run : pnpm install --frozen-lockfile
4138
42- - uses : actions/cache@v4
43- name : Setup pnpm cache
44- with :
45- path : ${{ env.STORE_PATH }}
46- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47- restore-keys : |
48- ${{ runner.os }}-pnpm-store-
39+ - name : Build Storybook
40+ run : pnpm storybook:build
4941
50- - name : Deploy Storybook
42+ - name : Deploy Storybook to GitHub Pages
5143 uses : bitovi/github-actions-storybook-to-github-pages@v1.0.2
5244 with :
53- install_command : pnpm install --frozen-lockfile
54- build_command : pnpm storybook:build
5545 path : storybook-static
5646 env :
57- GH_TOKEN : ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
47+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5848
49+ # Uncomment below when ready to publish to npm
5950 # - name: Build and publish to npm
60- # if: github.ref == 'refs/tags/v*' # Only run on version tags
51+ # if: startsWith( github.ref, 'refs/tags/v')
6152 # run: |
6253 # pnpm build
63- # npm login --registry=https://registry.npmjs.org/ --scope=your-scope
64- # npm publish
54+ # npm publish --access public
6555 # env:
66- # NODE_AUTH_TOKEN: ${{ secrets.YOUR_NPM_AUTH_TOKEN }}
56+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
0 commit comments