mirror of
https://github.com/sern-handler/automata
synced 2026-06-28 02:32:16 +00:00
Merge pull request #9 from sern-handler/feat/websitedocsgen
feat: website docs generation and instability fix
This commit is contained in:
2
index.ts
2
index.ts
@@ -26,6 +26,8 @@ app.post('/wh/updateDocsJson', async (req, res) => {
|
||||
success: true,
|
||||
error: 'Token valid, but ignoring action...'
|
||||
})
|
||||
// this line fixed the entire instability of automata
|
||||
return;
|
||||
}
|
||||
execa('bash', ['scripts/updateDocsJson.sh', process.env.GHTOKEN!, process.env.EMAIL!], { shell: true })
|
||||
res.send({
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd repos/sern-community
|
||||
git checkout main
|
||||
git pull
|
||||
# merge all changes from main to docsjson to be updated
|
||||
git checkout docsjson
|
||||
git merge main
|
||||
git -c user.name="sern bot" -c user.email="$2" commit -m "chore: merge changes from main"
|
||||
git push https://sernbot:$1@github.com/sern-handler/sern-community.git
|
||||
|
||||
cd ..
|
||||
cd website
|
||||
mv ./docusaurus.config.js ./original.docusaurus.config.js
|
||||
mv ./docgen.docusaurus.config.js ./docusaurus.config.js
|
||||
npm run build
|
||||
mv docusaurus.config.js docgen.docusaurus.config.js
|
||||
mv original.docusaurus.config.js docusaurus.config.js
|
||||
npm run typedoc-json
|
||||
git add .
|
||||
git -c user.name="sern bot" -c user.email="$2" commit -m "chore: update api documentation"
|
||||
git push https://sernbot:$1@github.com/sern-handler/website.git
|
||||
cd ..
|
||||
cd sern-community
|
||||
git add .
|
||||
git -c user.name="sern bot" -c user.email="$2" commit -m "chore: update typedoc"
|
||||
git push https://sernbot:$1@github.com/sern-handler/sern-community.git
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $1" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/sern-handler/sern-community/pulls \
|
||||
-d '{"title":"chore: update typedoc","body":"automated typedoc update (as of the new latest update in the handler)","head":"docsjson","base":"main"}'
|
||||
git checkout main
|
||||
git push https://sernbot:$1@github.com/sern-handler/sern-community.git
|
||||
@@ -9,6 +9,13 @@ mkdir repos
|
||||
cd repos
|
||||
echo " done"
|
||||
|
||||
if [$IS_SRIZAN == "true"]
|
||||
then
|
||||
echo -ne "Detected Sr Izan on development environment. chowning repos folder"
|
||||
sudo chown -R srizan:srizan .
|
||||
echo " done"
|
||||
fi
|
||||
|
||||
echo -ne "Installing sern CLI"
|
||||
npm install -g @sern/cli
|
||||
echo " done"
|
||||
|
||||
Reference in New Issue
Block a user