Add composition path prefix to storybook to allow publishing to gh-pages (#51700)
Add composition path prefix to storybook
This commit is contained in:
parent
645832da4b
commit
ed1e40204a
|
@ -27,6 +27,8 @@ jobs:
|
||||||
|
|
||||||
- name: Build Storybook
|
- name: Build Storybook
|
||||||
run: pnpm --filter='@woocommerce/storybook' build-storybook --quiet
|
run: pnpm --filter='@woocommerce/storybook' build-storybook --quiet
|
||||||
|
env:
|
||||||
|
STORYBOOK_COMPOSITION_PATH_PREFIX: /woocommerce
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
||||||
|
|
|
@ -28,11 +28,18 @@ module.exports = {
|
||||||
if ( configType === 'DEVELOPMENT' ) {
|
if ( configType === 'DEVELOPMENT' ) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let pathPrefix = (
|
||||||
|
process.env.STORYBOOK_COMPOSITION_PATH_PREFIX ?? ''
|
||||||
|
).trim();
|
||||||
|
if ( pathPrefix && ! pathPrefix.startsWith( '/' ) ) {
|
||||||
|
pathPrefix = '/' + pathPrefix;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
'woocommerce-blocks': {
|
'woocommerce-blocks': {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
title: 'WooCommerce Blocks',
|
title: 'WooCommerce Blocks',
|
||||||
url: '/assets/woocommerce-blocks',
|
url: pathPrefix + '/assets/woocommerce-blocks',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue