Skip to content

Commit

Permalink
Put docs release deployment in separate job (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Oct 19, 2021
1 parent de84af0 commit 803d80b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/utils/update_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e

echo -e "\n-o- Setting commit user -o-"
git config --global user.email "dev@optimade.org"
git config --global user.name "OPTIMADE Developers"
git config --global user.email "${GIT_USER_EMAIL}"
git config --global user.name "${GIT_USER_NAME}"

echo -e "\n-o- Update 'API Reference' docs -o-"
invoke create-api-reference-docs --pre-clean
Expand Down
36 changes: 34 additions & 2 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on:
types:
- published

env:
PUBLISH_UPDATE_BRANCH: master
GIT_USER_NAME: OPTIMADE Developers
GIT_USER_EMAIL: "dev@optimade.org"

jobs:

publish:
name: Publish OPTIMADE Python tools
runs-on: ubuntu-latest
if: github.repository == 'Materials-Consortia/optimade-python-tools' && startsWith(github.ref, 'refs/tags/v')
env:
PUBLISH_UPDATE_BRANCH: master

steps:
- name: Checkout repository
Expand Down Expand Up @@ -79,6 +82,35 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}

docs:
name: Deploy documentation
needs: publish
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
ref: ${{ env.PUBLISH_UPDATE_BRANCH }}

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Python dependencies
run: |
python -m pip install -U pip
pip install -U setuptools
pip install -U -e .[all]
- name: Set git config
run: |
git config --global user.name "${{ env.GIT_USER_NAME }}"
git config --global user.email "${{ env.GIT_USER_EMAIL }}"
- name: Deploy documentation
run: |
mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml ${GITHUB_REF#refs/tags/v} stable
Expand Down

0 comments on commit 803d80b

Please sign in to comment.