I was able to follow the guide and published this page: https://chengtie.github.io/docusaurus/docs/doc3/
Now, I want to do some small change. After changing code in my local folder. I did:
GIT_USER=chengtie \
CURRENT_BRANCH=master \
USE_SSH=true \
yarn run publish-gh-pages
Then, I got an error:
yarn run v1.16.0
error Command "publish-gh-pages" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Does anyone know how to solve this?
Edit 1:
Ties-MBP:my-website chengtie$ GIT_USER=chengtie CURRENT_BRANCH=master USE_SSH=true yarn run deploy
yarn run v1.16.0
$ docusaurus deploy
Deploy command invoked ...
fatal: not a git repository (or any of the parent directories): .git
Creating an optimized production build...
Success! Generated static files in build.
Cloning into 'docusaurus-gh-pages'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error: Error: git clone failed
at build_1.build.then (/Users/chengtie/Downloads/my-website/node_modules/@docusaurus/core/lib/commands/deploy.js:84:23)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Here is package.json
:
{
"name": "my-website",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.24",
"@docusaurus/preset-classic": "^2.0.0-alpha.24",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Docusaurus maintainer here!
yarn publish-gh-pages
is a V1 command. In V2 it should be yarn deploy
. I see that your linked site is a V2 site. Refer to the deployment docs here.
Try changing your command to:
GIT_USER=chengtie \
CURRENT_BRANCH=master \
USE_SSH=true \
yarn run deploy
Also inspect your package.json
and see what available npm scripts there are.