Skip to content

Commit 3e292e1

Browse files
authored
Update release.yml
Publish Storybook to GitHub Pages
1 parent 15f638d commit 3e292e1

1 file changed

Lines changed: 71 additions & 39 deletions

File tree

.github/workflows/release.yml

Lines changed: 71 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Release
33
on:
44
push:
55
branches:
6-
- release
6+
- release
77
pull_request:
88
branches:
9-
- release
9+
- release
1010

1111
jobs:
1212
release:
@@ -20,40 +20,72 @@ jobs:
2020
matrix:
2121
node-version: [22]
2222
steps:
23-
- uses: actions/checkout@v4
24-
- name: Install pnpm
25-
uses: pnpm/action-setup@v4
26-
with:
27-
version: 10
28-
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v4
30-
with:
31-
node-version: ${{ matrix.node-version }}
32-
registry-url: https://registry.npmjs.org/
33-
cache: 'pnpm'
34-
- name: Install dependencies
35-
run: pnpm install --frozen-lockfile
36-
- name: Validate Color Token
37-
run: npm run validate-color-token
38-
- name: Build carbon-react-native-elements
39-
run: |
40-
npm run prepack-carbon-react-native-elements
41-
npm run builder-bob carbon-react-native-elements
42-
- name: Build carbon-react-native
43-
run: |
44-
npm run prepack-carbon-react-native
45-
npm run builder-bob carbon-react-native
46-
- name: Code check
47-
run: npm run code-check
48-
# https://github.com/pnpm/pnpm/issues/4937
49-
- name: Set up special NPM voodoo
50-
run: |
51-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
52-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
53-
- name: Release to npm registry
54-
env:
55-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56-
NPM_CONFIG_PROVENANCE: true
57-
run: |
58-
pnpm publish --filter @audira/carbon-react-native-elements --access public --no-git-checks
59-
pnpm publish --filter @audira/carbon-react-native --access public --no-git-checks
23+
- uses: actions/checkout@v4
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 10
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
registry-url: https://registry.npmjs.org/
33+
cache: 'pnpm'
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
- name: Validate Color Token
37+
run: npm run validate-color-token
38+
- name: Build carbon-react-native-elements
39+
run: |
40+
npm run prepack-carbon-react-native-elements
41+
npm run builder-bob carbon-react-native-elements
42+
- name: Build carbon-react-native
43+
run: |
44+
npm run prepack-carbon-react-native
45+
npm run builder-bob carbon-react-native
46+
- name: Code check
47+
run: npm run code-check
48+
# https://github.com/pnpm/pnpm/issues/4937
49+
- name: Set up special NPM voodoo
50+
run: |
51+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
52+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
53+
- name: Release to npm registry
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
NPM_CONFIG_PROVENANCE: true
57+
run: |
58+
pnpm publish --filter @audira/carbon-react-native-elements --access public --no-git-checks
59+
pnpm publish --filter @audira/carbon-react-native --access public --no-git-checks
60+
61+
deploy-storybook:
62+
name: Deploy
63+
runs-on: ubuntu-latest
64+
needs: release
65+
environment: release
66+
permissions:
67+
contents: read
68+
pages: write
69+
id-token: write
70+
strategy:
71+
matrix:
72+
node-version: [22]
73+
steps:
74+
- uses: actions/checkout@v4
75+
- name: Install pnpm
76+
uses: pnpm/action-setup@v4
77+
with:
78+
version: 10
79+
- name: Use Node.js ${{ matrix.node-version }}
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: ${{ matrix.node-version }}
83+
registry-url: https://registry.npmjs.org/
84+
cache: 'pnpm'
85+
- name: Deploy Storybook to Github Pages
86+
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
87+
with:
88+
install_command: pnpm install --frozen-lockfile
89+
build_command: cd storybook && npm run storybook:build
90+
path: ./storybook/.dist
91+
checkout: false

0 commit comments

Comments
 (0)