Merge pull request #16 from Advestis/refactoring #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
concurrency: | |
group: doc | |
cancel-in-progress: true | |
name: push-doc | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: " | |
!endsWith(github.event.head_commit.message, '!minor') | |
&& !endsWith(github.event.head_commit.message, '!wip') | |
&& !endsWith(github.event.head_commit.message, '!WIP') | |
&& !startsWith(github.event.head_commit.message, 'test') | |
" | |
strategy: | |
matrix: | |
python-version: [ 3.9 ] | |
steps: | |
- name: Set envvars | |
run: | | |
repo_name=$(echo ${{ github.repository }} | sed "s/${{ github.repository_owner }}\///g") | |
echo "Repo name is $repo_name" | |
echo "REPO_NAME=$repo_name" >> $GITHUB_ENV | |
- uses: actions/checkout@master | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
ref: ${{ github.head_ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }} | |
- name: build | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade --upgrade-strategy eager . | |
- name: make doc | |
run: | | |
pip install --upgrade --upgrade-strategy eager pdoc3 | |
pdoc --html ${{ env.REPO_NAME }} -o docs | |
mv docs/${{ env.REPO_NAME }}/* docs/ | |
rm -r docs/${{ env.REPO_NAME }} | |
- name: commit doc | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "docs" | |
- name: Push doc | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.ORG_TOKEN_CICD }} | |
branch: "gh-pages" | |
force: true |