Skip to content

Commit

Permalink
🐛 fix documentation publication
Browse files Browse the repository at this point in the history
  • Loading branch information
nlepage committed Sep 4, 2017
1 parent 5f7b6b9 commit ac42a4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 1 addition & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ deployment:
tag: /\d+\.\d+\.\d+/
commands:
- npm publish
# To be fixed, see https://github.com/Zenika/immutadot/issues/89
# - ./publish-docs.sh
- ./publish-docs.sh
20 changes: 15 additions & 5 deletions publish-docs.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#!/bin/sh
set -e

# Git configuration
git config user.name $GIT_USER_NAME
git config user.email $GIT_USER_EMAIL

# Build documentation
yarn docs

# Move to new branch based on master
git checkout master
git checkout -b docs/$CIRCLE_TAG

# Apply modifications to minor version
VERSION_TO_MINOR=$(echo $CIRCLE_TAG | sed -E 's/\.[0-9]+$//')
rm -rf docs/immutadot/$VERSION_TO_MINOR
mv docs/immutadot/$CIRCLE_TAG docs/immutadot/$VERSION_TO_MINOR
git config user.name $GIT_USER_NAME
git config user.email $GIT_USER_EMAIL
git checkout master

# Commit and push modifications
git add docs/immutadot
git commit -m ":memo: Publish documentation"
git pull -r origin master && git push origin master
git commit -m ":memo: Publish $CIRCLE_TAG documentation"
git push --set-upstream origin docs/$CIRCLE_TAG

0 comments on commit ac42a4f

Please sign in to comment.