Skip to content

Commit 09db4b0

Browse files
committed
fix: workflows
1 parent e776eb9 commit 09db4b0

2 files changed

Lines changed: 16 additions & 38 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,8 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: 20
30-
cache: 'pnpm'
31-
32-
- name: Get pnpm store directory
33-
shell: bash
34-
run: |
35-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
36-
37-
- uses: actions/cache@v4
38-
name: Setup pnpm cache
39-
with:
40-
path: ${{ env.STORE_PATH }}
41-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42-
restore-keys: |
43-
${{ runner.os }}-pnpm-store-
30+
cache: "pnpm"
31+
cache-dependency-path: pnpm-lock.yaml # 👈 Explicitly tell setup-node where to find lockfile
4432

4533
- name: Install dependencies
4634
run: pnpm install --frozen-lockfile

.github/workflows/publish.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
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-
41
name: Publish
52

63
on:
@@ -9,13 +6,14 @@ on:
96
types: [published]
107

118
permissions:
12-
contents: read
9+
contents: write # Needed to push to gh-pages
1310
pages: write
1411
id-token: write
1512

1613
jobs:
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

Comments
 (0)