Merge pull request #22 from tiktok/octogonz/website-ci

Fix an issue where the website project did not get built by CI
This commit is contained in:
Pete Gonzalez 2024-02-23 16:45:21 -08:00 committed by GitHub
commit 134626ef93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

22
apps/website/build.js Normal file
View file

@ -0,0 +1,22 @@
const { spawnSync } = require('child_process');
function runCommand(command, args) {
const result = spawnSync(command, args, { stdio: 'inherit', shell: true });
if (result.error) {
console.log(result.error.message);
process.exitCode = 1;
return false;
}
process.exitCode = result.status;
return result.status ? false : true;
}
const docusaurusPath = __dirname + '/node_modules/.bin/docusaurus';
console.log('docusaurus clear');
runCommand(docusaurusPath, ['clear']);
console.log('docusaurus build');
runCommand(docusaurusPath, ['build']);
console.log('done.');

View file

@ -4,6 +4,8 @@
"private": true,
"description": "The Sparo documentation website",
"scripts": {
"_phase:build": "node build.js",
"_phase:test": "",
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",