diff --git a/scripts/publish_docs.js b/scripts/publish_docs.js index b4ea0720565..a27ea6696f1 100644 --- a/scripts/publish_docs.js +++ b/scripts/publish_docs.js @@ -13,9 +13,9 @@ if (!msg) { exec('yarn install', { cwd: './docs' }) exec('rm -rf ./out', { cwd: './docs' }) -exec('git clone -b gh-pages --single-branch git@github.com:DataDog/dd-trace-js.git docs/out') -exec('rm -rf ./docs/out') -exec('yarn type:doc') +exec('yarn type:doc') // run first because typedoc requires an empty directory +exec('git init', { cwd: './docs/out' }) // cloning would overwrite generated docs +exec('git remote add origin git@github.com:DataDog/dd-trace-js.git', { cwd: './docs/out' }) exec('git add -A', { cwd: './docs/out' }) exec(`git commit -m "${msg}"`, { cwd: './docs/out' }) -exec('git push', { cwd: './docs/out' }) +exec('git push -f master:gh-pages', { cwd: './docs/out' })