Skip to content

Commit db8cedf

Browse files
committed
fix: refactor and update storybook deploy action
1 parent bfaf22c commit db8cedf

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/storybook.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ jobs:
1414
run: | # Install npm packages and build the Storybook files
1515
npm install --force
1616
npm run build-storybook
17+
- name: Get commit info
18+
shell: bash
19+
run: |
20+
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
1721
- name: Deploy 🚀
18-
uses: JamesIves/github-pages-deploy-action@v4
22+
uses: crazy-max/ghaction-github-pages@v3
1923
with:
20-
token: ${{ secrets.GITHUB_TOKEN }}
21-
branch: docs # The branch the action should deploy to.
22-
folder: docs-build # The folder that the build-storybook script generates files.
23-
clean: true # Automatically remove deleted files from the deploy branch
24-
clean-exclude: |
25-
.nojekyll
26-
target-folder: docs # The folder that we serve our Storybook files from
24+
target_branch: docs
25+
build_dir: docs-build
26+
commit_message: 'Deploying to docs from ${{ env.sha_short }}'
27+
keep_history: false
28+
jekyll: false
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test": "react-scripts test",
2121
"prepublishOnly": "yarn build",
2222
"storybook": "storybook dev",
23-
"build-storybook": "storybook build -c .storybook -o docs-build .out && touch ./docs-build/.nojekyll"
23+
"build-storybook": "storybook build -c .storybook -o docs-build .out"
2424
},
2525
"release": {
2626
"branches": [

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const App = () => {
2828
]
2929

3030
return (
31-
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column', gap: 32, width: '100%', marginTop: 32 }}>
31+
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column', gap: 32, width: '100%', marginTop: 24 }}>
3232
<div style={{ padding: '24px 0', width: '60%' }}>
3333
<UsageBar showFallbackColors items={itemsToDisplay} total={100} />
3434
</div>

0 commit comments

Comments
 (0)