Skip to content

Commit

Permalink
Update doc build script
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed May 16, 2021
1 parent a5d0005 commit 11c5924
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions update-gh-pages.sh
Expand Up @@ -6,6 +6,21 @@ latest_tag_hash=$(git rev-list --tags --max-count=1)
latest_tag=$(git describe "$latest_tag_hash")
git checkout "$latest_tag"

# Make sure we have gh-pages directory
if [ ! -d gh-pages ]; then
git clone git@github.com:JelteF/derive_more --branch gh-pages gh-pages
fi

# Make sure the gh-pages directory has the latest commits
(
cd gh-pages
git fetch
git checkout gh-pages
git reset --hard origin/gh-pages
)

# Remove old docs
rm -rf gh-pages/*
# build docs
rm -rf target/debug
cargo +nightly build
Expand All @@ -14,7 +29,12 @@ cargo +nightly external-doc
git checkout -

# Push doc changes
cd gh-pages
git add .
git commit -m "Update docs for $latest_tag release"
git push
(
cd gh-pages
git add .
git commit -m "Update docs for $latest_tag release"
git push
)

# Go back to previous commit instead of latest tag
git checkout -

0 comments on commit 11c5924

Please sign in to comment.