mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
build(scripts): publish examples using gh-pages
This commit is contained in:
parent
efbb61b646
commit
a85dade8ff
3 changed files with 163 additions and 11 deletions
31
scripts/publish-examples.js
Normal file
31
scripts/publish-examples.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
const ghpages = require("gh-pages");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { promisify } = require("util");
|
||||
|
||||
const ghPublish = promisify(ghpages.publish);
|
||||
|
||||
async function publishExample(name) {
|
||||
try {
|
||||
const folder_path = path.join("examples", name);
|
||||
await ghPublish(folder_path, {
|
||||
branch: name,
|
||||
dotfiles: true,
|
||||
history: false,
|
||||
});
|
||||
console.log("Published example:", name);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
ghpages.clean();
|
||||
|
||||
await publishExample("rollup");
|
||||
await publishExample("rollup-typescript");
|
||||
await publishExample("routify");
|
||||
await publishExample("sapper");
|
||||
await publishExample("svite");
|
||||
await publishExample("webpack");
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue