Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: update package layout and continuous deployment #268

Merged
merged 9 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions .github/workflows/ci-build.yml → .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
MAIN_PYTHON_VERSION: '3.10'
CNAME: 'dev.docs.pyansys.com'
DOCUMENTATION_CNAME: 'dev.docs.pyansys.com'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -53,23 +53,11 @@ jobs:
requires-xvfb: true
dependencies: 'xvfb texlive-latex-extra latexmk nodejs npm'

doc-deploy:
name: "Deploy development documentation"
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: doc-build
steps:
- name: "Deploy development documentation"
uses: pyansys/actions/doc-deploy-dev@v3
with:
cname: ${{ env.CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

release-github:
name: "Release to GitHub"
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: doc-deploy
if: github.ref == 'refs/heads/main'
needs: doc-build
steps:

- name: "Download HTML documentation"
Expand Down Expand Up @@ -106,3 +94,17 @@ jobs:
files: |
documentation-html.zip
documentation-pdf
doc-deploy:
name: "Deploy documentation"
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: release-github
steps:
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/_build/html
cname: ${{ env.DOCUMENTATION_CNAME }}
full_commit_message: ${{ github.event.head_commit.message }}
force_orphan: true
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ repos:
rev: 23.1.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
hooks:
- id: black
args: ["doc/source/conf.py"]
args: [
"doc/source/conf.py",
"examples"
]

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.13.0
Expand All @@ -29,10 +32,10 @@ repos:
- id: flake8

- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.1
hooks:
- id: codespell
args: [--ignore-words=ignore_words.txt, -S \*.pyc\,\*.xml\,\*.txt\,\*.gif\,\*.png\,\*.jpg\,\*.js\,\*.html\,\*.doctree\,\*.ttf\,\*.woff\,\*.woff2\,\*.eot\,\*.mp4\,\*.inv\,\*.pickle\,\*.ipynb\,flycheck\*\,./.git/\*\,./.hypothesis/\*\,\*.yml\,./doc/build/\*\,./doc/images/\*\,./dist/\*\,\*~\,.hypothesis\*\,./doc/source/examples/\*\,\*cover\,\*.dat\,\*.mac]
args: ["--ignore-words", "doc/styles/Vocab/ANSYS/accept.txt"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
project = "PyAnsys Developer's Guide"
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
author = "Ansys Inc."
release = version = "0.3.dev0"
release = version = datetime.now().strftime("%Y-%m-%d")

html_logo = pyansys_logo_black
html_theme = "ansys_sphinx_theme"
Expand Down
1 change: 1 addition & 0 deletions doc/styles/Vocab/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ Muela
Kaszynski
cybersecurity
substring
parm
24 changes: 0 additions & 24 deletions ignore_words.txt

This file was deleted.

4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,4 @@ deps =
-r{toxinidir}/requirements/requirements_doc.txt
allowlist_externals=*
commands =
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxworkdir}/doc_out_html" --color -vW -b html
touch "{toxworkdir}/doc_out_html/.nojekyll"
bash -c 'echo "dev.docs.pyansys.com" > "{toxworkdir}/doc_out_html/CNAME"'
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxinidir}/doc/_build/html" --color -vW -b html