Skip to content

Commit

Permalink
Try and replace bad asset paths in GH Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cwolf10 committed Jan 4, 2024
1 parent 9ab64a2 commit 37773c8
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build Storybook Assets
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: ng run sam-design-system-site:build-storybook
run: GH_PAGES=true ng run sam-design-system-site:build-storybook
- name: Add .nojekyll file to allow for node_modules to be included in bundle
run: touch storybook-static/.nojekyll
- name: Deploy 🚀
Expand Down
14 changes: 13 additions & 1 deletion .storybook/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,17 @@ module.exports = {

docs: {
autodocs: false
}
},
webpackFinal: async (config) => {
if (process.env.GH_PAGES) {
config.module.rules.push({
loader: 'string-replace-loader',
options: {
search: '/assets/',
replace: '/sam-design-system/assets/',
},
});
}
return config;
},
};
85 changes: 84 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"react-syntax-highlighter": "^15.5.0",
"storybook": "^7.5.0",
"storybook-addon-preview": "^2.3.0",
"string-replace-loader": "^3.1.0",
"ts-node": "~7.0.0",
"tslint": "~6.1.3"
}
Expand Down

0 comments on commit 37773c8

Please sign in to comment.