Skip to content

Commit

Permalink
"Docs" folder was not being 'built' by 'build.js'. Fixed. (#137)
Browse files Browse the repository at this point in the history
* "Docs" folder was not being 'built' by 'build.js'. Fixed.

* Fix package.json and pipeline

---------

Co-authored-by: FAP-Foundation <[email protected]>
Co-authored-by: BearToCode <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent bd45020 commit 983c187
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
- name: Build packages
run: pnpm run build

- name: Build docs
run: pnpm run build
working-directory: docs

- name: Deploy pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
14 changes: 9 additions & 5 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ const spinner = ora().start();

spinner.color = 'red';

for (const [index, pkg] of packages.entries()) {
spinner.text = `Building ${pkg} [${index + 1}/${packages.length}]`;
// Include docs in the build process
const buildTargets = [...packages, 'docs'];

for (const [index, target] of buildTargets.entries()) {
spinner.text = `Building ${target} [${index + 1}/${buildTargets.length}]`;
try {
await execAsync(`npm run build`, `./packages/${pkg}`);
const buildPath = target === 'docs' ? './docs' : `./packages/${target}`;
await execAsync(`pnpm run build`, buildPath);
} catch (e) {
spinner.fail(`Failed to build ${pkg}: \n ${e}`);
spinner.fail(`Failed to build ${target}: \n ${e}`);
process.exit(1);
}
}

spinner.succeed(`All packages built`);
spinner.succeed(`All packages and docs built`);

0 comments on commit 983c187

Please sign in to comment.