Skip to content

Commit

Permalink
Move story images inside repo (#766)
Browse files Browse the repository at this point in the history
* feat: move story and editor images inside repo

---------

Co-authored-by: Vladislav Kharitonov <[email protected]>
  • Loading branch information
gorgeousvlad and Vladislav Kharitonov authored Jan 16, 2024
1 parent d960ea0 commit 325e620
Show file tree
Hide file tree
Showing 122 changed files with 544 additions and 519 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [main]

env:
PREVIEW_DEST_PATH: /page-constructor/main/

jobs:
main:
name: Build and Deploy
Expand All @@ -27,6 +30,6 @@ jobs:
uses: gravity-ui/preview-upload-to-s3-action@v1
with:
src-path: storybook-static
dest-path: /page-constructor/main/
dest-path: ${{ env.PREVIEW_DEST_PATH }}
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
3 changes: 3 additions & 0 deletions .github/workflows/pr-preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: PR Preview Build
on:
pull_request:

env:
PREVIEW_DEST_PATH: /page-constructor/${{ github.event.pull_request.number }}

jobs:
build:
name: Build
Expand Down
22 changes: 21 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import {resolve} from 'path';
import WebpackShellPluginNext from 'webpack-shell-plugin-next';
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';

const ASSET_PATH = 'story-assets';
const PREVIEW_DEST_PATH = process.env.PREVIEW_DEST_PATH;

const customAlias = {
widget: resolve(__dirname, '../widget'),
};
Expand All @@ -14,6 +17,7 @@ const config = {
autodocs: true,
},
stories: ['./stories/**/*.mdx', '../src/**/__stories__/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
staticDirs: ['./public'],
addons: [
'@storybook/preset-scss',
{
Expand All @@ -32,14 +36,30 @@ const config = {
new WebpackShellPluginNext({
onBuildStart: {
scripts: ['npm run build:widget'],
blocking: true,
blocking: false,
},
}),
);

storybookBaseConfig.resolve.alias = {
...(storybookBaseConfig.resolve?.alias || {}),
...customAlias,
};

// main and branch storybook previews are deployed in subfolders
// so we need to add subfolder prefix to stories asset static path:
if (PREVIEW_DEST_PATH) {
storybookBaseConfig.module.rules.push({
test: /data\.json$/,
loader: 'string-replace-loader',
options: {
search: `/${ASSET_PATH}/`,
replace: `${PREVIEW_DEST_PATH}/${ASSET_PATH}/`,
flags: 'g',
},
});
}

return storybookBaseConfig;
},
};
Expand Down
2 changes: 1 addition & 1 deletion .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link rel="icon" href="https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/favicon.png" />
<link rel="icon" href="/story-assets/favicon.png" />
Binary file added .storybook/public/story-assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions .storybook/public/story-assets/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_1_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_1_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_2_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_2_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_3_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_3_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icon_4_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icons-link_1_64.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icons-link_2_64.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icons-link_3_64.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icons-link_4_64.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .storybook/public/story-assets/icons-link_5_64.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .storybook/public/story-assets/img-black.png
Binary file added .storybook/public/story-assets/img-gray.png
Binary file added .storybook/public/story-assets/img_6-12_light.png
Binary file added .storybook/public/story-assets/img_6-12_white.png
Binary file added .storybook/public/story-assets/img_8-12_light.png
Binary file added .storybook/public/story-assets/img_8-12_white.png
10 changes: 10 additions & 0 deletions .storybook/public/story-assets/logo-svg_12-12_desktop_dark.svg
Loading

0 comments on commit 325e620

Please sign in to comment.