Skip to content

Commit

Permalink
CI: deploy to stable and latest doc repos
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto committed Sep 21, 2022
1 parent 39eec01 commit fbb0166
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ jobs:
python -m pip install --upgrade pip tox
- name: Generate the documentation with tox
run: tox -e doc
run: |
tox -e doc
- name: Upload documentation as artifact
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -194,7 +195,7 @@ jobs:
path: dist/
retention-days: 7

release:
release_pkg:
name: Release project
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build]
Expand Down Expand Up @@ -236,3 +237,46 @@ jobs:
./**/*.whl
./**/*.tar.gz
./**/*.zip
release_docs:
name: Upload documentation
if: (github.event_name == 'push' && contains(github.ref, 'refs/tags')) || (github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: HTML-Documentation
path: HTML-Documentation

- name: Get Bot Application Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v2
with:
application_id: ${{ secrets.BOT_APPLICATION_ID }}
application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }}

- name: Deploy documentation to pyoptislang-dev-docs repository
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
repository-name: pyansys/pygeometry-dev-docs
token: ${{ steps.get_workflow_token.outputs.token }}
branch: gh-pages
folder: HTML-Documentation
clean: true
single-commit: true

- name: Deploy documentation to pyoptislang-docs repository
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: pyansys/pygeometry-docs
token: ${{ steps.get_workflow_token.outputs.token }}
branch: gh-pages
folder: HTML-Documentation
clean: true
single-commit: true

0 comments on commit fbb0166

Please sign in to comment.