Skip to content

Commit

Permalink
Merge pull request #991 from opencobra/chore-deploy-website
Browse files Browse the repository at this point in the history
chore: update configuration for website deployment
  • Loading branch information
Midnighter authored Aug 24, 2020
2 parents bb5abbb + 5edcce6 commit 7529540
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@ jobs:
prerelease: false
- name: Publish to website
run: ./scripts/deploy_website.sh
shell: bash
env:
TAG: ${{ steps.tag.outputs.version }}
WORKSPACE: ${{ github.workspace }}
WEBSITE_DEPLOY_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
21 changes: 11 additions & 10 deletions scripts/deploy_website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

set -eu

target=/tmp/cobrapy-website
target="${TMP}/cobrapy-website"

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

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

git checkout stable
python "${TRAVIS_BUILD_DIR}"/scripts/publish_release.py "${TRAVIS_BUILD_DIR}"/release-notes "${target}"/content/releases "${TRAVIS_TAG}"
git checkout master
python "${WORKSPACE}/scripts/publish_release.py" "${WORKSPACE}/release-notes" "${target}/content/releases" "${TAG}"
git add .
git commit -m "feat: publish ${TRAVIS_TAG} on $(date +'%F %T')"
git push origin stable
cd "${TRAVIS_BUILD_DIR}"
git commit -m "feat: publish ${TAG} on $(date --utc --iso-8601=seconds)"
git push origin master

popd

0 comments on commit 7529540

Please sign in to comment.