-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add storybook and animated planet component (#2)
* feat: add storybook and animated planet component * chore: upload static to S3
- Loading branch information
Showing
23 changed files
with
15,371 additions
and
5,494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,69 @@ jobs: | |
cache: "npm" | ||
- run: npm ci | ||
- run: npm test | ||
|
||
deploy-static: | ||
runs-on: ubuntu-latest | ||
environment: CI | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npm run build-storybook | ||
- run: npm run build | ||
env: | ||
DOCUSAURUS_URL: https://storage.yandexcloud.net | ||
DOCUSAURUS_BASE_URL: ${{ secrets.AWS_S3_BUCKET }}/testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/ | ||
- name: Upload storybook static | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --acl public-read --follow-symlinks | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_S3_ENDPOINT: https://s3.yandexcloud.net/ | ||
SOURCE_DIR: "storybook-static" | ||
DEST_DIR: "testplane-docs/storybook-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/" | ||
- name: Upload website static | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --acl public-read --follow-symlinks | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_S3_ENDPOINT: https://s3.yandexcloud.net/ | ||
SOURCE_DIR: "build" | ||
DEST_DIR: "testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/" | ||
|
||
- name: Comment PR with links to deployed static on success | ||
if: ${{ success() }} | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: | | ||
### :white_check_mark: Successfully deployed static | ||
- [Docs website](https://storage.yandexcloud.net/testplane-ci/testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html) | ||
- [Storybook](https://storage.yandexcloud.net/testplane-ci/testplane-docs/storybook-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html) | ||
comment_tag: deployment_status | ||
|
||
- name: Comment PR that static wasn't deployed on failure | ||
if: ${{ failure() }} | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: | | ||
### :x: Failed to deploy static | ||
Please check the workflow logs for details. | ||
comment_tag: deployment_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ build | |
LICENSE | ||
package.json | ||
package-lock.json | ||
storybook-static | ||
build | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-webpack5-compiler-swc", | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@chromatic-com/storybook", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
swc: () => ({ | ||
jsc: { | ||
transform: { | ||
react: { | ||
runtime: "automatic", | ||
}, | ||
}, | ||
}, | ||
}), | ||
webpackFinal: config => { | ||
return { | ||
...config, | ||
resolve: { | ||
...config.resolve, | ||
alias: { | ||
...config.resolve?.alias, | ||
"@site": path.resolve(fileURLToPath(import.meta.url), "../.."), | ||
}, | ||
}, | ||
module: { | ||
...config.module, | ||
rules: [ | ||
...(config.module?.rules as Record<string, any>[]), | ||
{ | ||
test: /\.(sa|sc|c)ss$/, | ||
use: [ | ||
"style-loader", | ||
"css-loader", | ||
{ | ||
loader: "postcss-loader", | ||
options: { | ||
postcssOptions: { | ||
ident: "postcss", | ||
plugins: [ | ||
require("postcss-import"), | ||
require("tailwindcss"), | ||
require("autoprefixer"), | ||
], | ||
}, | ||
}, | ||
}, | ||
"sass-loader", | ||
], | ||
}, | ||
], | ||
}, | ||
}; | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
import "../src/scss/custom.scss"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.