mirror of
https://github.com/google/guice.git
synced 2024-04-21 12:32:36 +00:00
Need to check if the latest api directory exists before deleting it, otherwise git complains about non-existing path: fatal: pathspec 'api-docs/latest' did not match any files. PiperOrigin-RevId: 427042438
27 lines
770 B
Bash
Executable File
27 lines
770 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
bash $(dirname $0)/generate-latest-docs.sh
|
|
|
|
echo -e "Publishing javadoc & JDiff...\n"
|
|
mkdir -p $HOME/guice-docs/latest
|
|
cp -R build/docs/* $HOME/guice-docs/latest/
|
|
|
|
cd $HOME
|
|
git config --global user.email "guice-dev+github@google.com"
|
|
git config --global user.name "guice-dev+github"
|
|
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/google/guice gh-pages > /dev/null
|
|
|
|
cd gh-pages
|
|
if [[ -d api-docs/latest ]]; then
|
|
git rm -rf api-docs/latest
|
|
fi
|
|
mkdir -p api-docs/latest
|
|
cp -rf $HOME/guice-docs/latest/* api-docs/latest/
|
|
git add -f .
|
|
git commit -m "Latest javadoc & api-diffs on successful CI build $GITHUB_SHA auto-pushed to gh-pages"
|
|
git push -fq origin gh-pages > /dev/null
|
|
|
|
echo -e "Published Javadoc & JDiff to gh-pages.\n"
|