Skip to content

Commit

Permalink
fix: correct the website deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Oct 30, 2017
1 parent f7e2a43 commit 098e92b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ deploy:
tags: true
repo: $GITHUB_REPO
- provider: script
skip_cleanup: true
script: scripts/deploy_website.sh
on:
tags: true
repo: $GITHUB_REPO
condition: $TRAVIS_OS_NAME == "linux" && $MB_PYTHON_VERSION == "3.6"
- provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
body: "Please see https://github.com/opencobra/cobrapy/tree/${TRAVIS_TAG}/release-notes/${TRAVIS_TAG}.md for the full release notes."
on:
Expand Down
8 changes: 7 additions & 1 deletion scripts/deploy_website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ target=/tmp/cobrapy-website

git clone "https://github.com/opencobra/cobrapy-website.git" "${target}"
cd "${target}"

git config user.name "Deployment Bot"
git config user.email "deploy@travis-ci.org"
git remote rm origin
git remote add origin "https://user:${GITHUB_TOKEN}@github.com/opencobra/cobrapy-website.git" &> /dev/null

git checkout master
python "${TRAVIS_BUILD_DIR}"/scripts/publish_releases.py "${TRAVIS_BUILD_DIR}"/release-notes "${target}"/content/releases "${TRAVIS_TAG}"
python "${TRAVIS_BUILD_DIR}"/scripts/publish_release.py "${TRAVIS_BUILD_DIR}"/release-notes "${target}"/content/releases "${TRAVIS_TAG}"
git add .
git commit -m "feat: publish ${TRAVIS_TAG} on $(date +'%F %T')"
git push origin master
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def insert_break(lines, break_pos=9):
def line_filter(line):
if len(line) == 0:
return True
return any(line.startswith(c) for c in "-*+"):
return any(line.startswith(c) for c in "-*+")

if len(lines) <= break_pos:
return lines
Expand Down

0 comments on commit 098e92b

Please sign in to comment.