Skip to content

Commit

Permalink
modify storybook action cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
imagine10255 committed Oct 17, 2024
1 parent ade6fbf commit 9d066d6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Storybook to Pages

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Replace local links with actual versions
run: |
sed -i 's#"@acrool/react-skeleton": "link:.."#"@acrool/react-skeleton": "1.0.0"#' package.json
sed -i 's#"react": "link:../node_modules/react"#"react": "^18.0.0"#' package.json
sed -i 's#"react-dom": "link:../node_modules/react-dom"#"react-dom": "^18.0.0"#' package.json
- name: Install dependencies
run: yarn install

- name: Build Storybook
run: yarn build-storybook

- name: Install Wrangler
run: yarn global add wrangler

- name: Deploy to Cloudflare Pages
run: wrangler pages deploy ./storybook-static --project-name=acrool-react-skeleton --branch main
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
8 changes: 3 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"pages:dev": "wrangler pages dev --proxy 3000 -- yarn dev",
"pages:deploy": "NODE_VERSION=18 yarn build-storybook && wrangler pages deploy ./storybook-static"
"pages:deploy": "NODE_VERSION=18 yarn build-storybook && wrangler pages deploy ./storybook-static --project-name=acrool-react-skeleton --branch main"
},
"resolutions": {
"styled-components": "5.3.9"
},
"dependencies": {
"@acrool/js-utils": "^3.2.12",
"@acrool/react-grid": "^5.2.5-alpha.0",
"@acrool/react-skeleton": "link:..",
"@acrool/react-skeleton": "1.0.0",
"@swc/core": "^1.3.68",
"@swc/plugin-styled-components": "^1.5.68",
"@types/dom-to-image": "^2.6.7",
Expand All @@ -26,9 +26,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "5.3.9",
"sass": "^1.77.1"
},
"devDependencies": {
"sass": "^1.77.1",
"@chromatic-com/storybook": "^1.5.0",
"@emotion/is-prop-valid": "^1.2.2",
"@storybook/addon-essentials": "^8.1.10",
Expand Down
9 changes: 6 additions & 3 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
resolved "https://registry.yarnpkg.com/@acrool/react-grid/-/react-grid-5.2.5-alpha.0.tgz#7da9768ce8d95dd97a403b48ae47d590711a4e26"
integrity sha512-9HVqXgyBwrOBOYltufu0ALXAiOXSnM4T7ch67nOh0GrDcFVKQO7NIw7wTIH/pgE8pNefDx3yWhOfisSQS4g+mg==

"@acrool/react-skeleton@link:..":
version "0.0.0"
uid ""
"@acrool/react-skeleton@1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@acrool/react-skeleton/-/react-skeleton-1.0.0.tgz#8f7609f8c717e31be83f8553b0f3abd41af9679d"
integrity sha512-K5zkUQu/tOnaZGnwmTyWYyZRiaxznhyL/BiqmuMLq6XHssCtQf2PZg/+fpeQn4YW9em+MYieuCVIiqhJm/TfMw==
dependencies:
clsx "2.1.1"

"@adobe/css-tools@^4.3.2":
version "4.4.0"
Expand Down

0 comments on commit 9d066d6

Please sign in to comment.