Skip to content

Commit

Permalink
fix: docusaurus reload on change (#1663)
Browse files Browse the repository at this point in the history
* fix: docusaurus reload on change

* feat: removed Render logic from actions

* fix: build for when docs didn't change
  • Loading branch information
gagdiez authored Jan 13, 2024
1 parent d0c01b4 commit a5b01de
Show file tree
Hide file tree
Showing 6 changed files with 648 additions and 653 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ jobs:
run: |
cd website
yarn
yarn build:main
yarn build
yarn crowdin:upload
- name: Commit build
run: |
git add -f ./website/build ./website/.docusaurus ./website/i18n
git commit -m "Merge with master"
git push
if git commit -m "add new build";then
git push
else
echo "Nothing to commit"
fi
env:
NODE_OPTIONS: --max-old-space-size=8192
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
cd website
yarn
yarn crowdin:download
yarn build:main
yarn build
- name: Commit build
run: |
Expand Down
6 changes: 4 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
const changelogs = require('./src/utils/changelogs.json');

/** @type {import('@docusaurus/types').Config} */
module.exports = {
const config = {
title: 'NEAR Documentation',
tagline: 'NEAR Protocol Developer Documentation',
url: 'https://docs.near.org',
Expand Down Expand Up @@ -40,7 +40,7 @@ module.exports = {
breadcrumbs: true,
editUrl: 'https://github.com/near/docs/edit/master/website',
path: '../docs',
sidebarPath: './sidebars.json',
sidebarPath: './sidebars.js',
routeBasePath: '/',
},
sitemap: {
Expand Down Expand Up @@ -271,3 +271,5 @@ ${content}`, // <-- this last part adds in the rest of the content, which would
},
},
};

export default config;
19 changes: 9 additions & 10 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"scripts": {
"full-test": "./test-links.sh test",
"start": "docusaurus start",
"build": "if [ \"$IS_PULL_REQUEST\" = \"true\" ]; then $npm_execpath run build:preview; fi",
"build:main": "docusaurus build",
"build": "docusaurus build",
"build:preview": "docusaurus build --locale en",
"swizzle": "docusaurus swizzle",
"docusaurus": "docusaurus",
Expand All @@ -16,8 +15,8 @@
"crowdin:download": "crowdin download"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.1",
"@docusaurus/types": "3.0.1",
"@docusaurus/module-type-aliases": "3.1.0",
"@docusaurus/types": "3.1.0",
"@types/react": "^18.2.42",
"buffer": "^6.0.3",
"concurrently": "^5.3.0",
Expand All @@ -34,11 +33,11 @@
"dependencies": {
"@algolia/autocomplete-js": "^1.7.1",
"@crowdin/cli": "^3.9.0",
"@docusaurus/core": "^3.0.1",
"@docusaurus/plugin-ideal-image": "^3.0.1",
"@docusaurus/plugin-sitemap": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@docusaurus/theme-mermaid": "^3.0.1",
"@docusaurus/core": "^3.1.0",
"@docusaurus/plugin-ideal-image": "^3.1.0",
"@docusaurus/plugin-sitemap": "^3.1.0",
"@docusaurus/preset-classic": "^3.1.0",
"@docusaurus/theme-mermaid": "^3.1.0",
"@near-wallet-selector/core": "^8.5.1",
"@near-wallet-selector/here-wallet": "^8.5.1",
"@near-wallet-selector/modal-ui": "^8.5.1",
Expand All @@ -55,7 +54,7 @@
"https-browserify": "^1.0.0",
"monaco-editor": "^0.44.0",
"near-api-js": "^2.1.4",
"near-social-vm": "github:NearSocial/VM#2.5.3",
"near-social-vm": "github:NearSocial/VM#2.5.5",
"react": "^18.2.0",
"react-bootstrap": "^2.9.1",
"react-bootstrap-typeahead": "^6.3.2",
Expand Down
6 changes: 4 additions & 2 deletions website/sidebars.json → website/sidebars.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
const sidebar = {
"concepts": [
"concepts/welcome",
"concepts/basics/protocol",
Expand Down Expand Up @@ -901,4 +901,6 @@
},
"integrator/faq"
]
}
};

export default sidebar;
Loading

0 comments on commit a5b01de

Please sign in to comment.