Skip to content

Commit 505528c

Browse files
authored
MAINT: update package layout and continuous deployment (#268)
* DOC: tox doc output to doc/_build/html * CI: renmae ci-build.yml -> ci_cd.yml * MAINT: point codespell to Vale words * MAINT: remove unnecessary Makefile * DOC: format Python examples * DOC: accept 'param' word * CI: update workflows * CI: update version naming
1 parent dc2e02d commit 505528c

File tree

7 files changed

+26
-59
lines changed

7 files changed

+26
-59
lines changed

.github/workflows/ci-build.yml renamed to .github/workflows/ci_cd.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
MAIN_PYTHON_VERSION: '3.10'
13-
CNAME: 'dev.docs.pyansys.com'
13+
DOCUMENTATION_CNAME: 'dev.docs.pyansys.com'
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
@@ -53,23 +53,11 @@ jobs:
5353
requires-xvfb: true
5454
dependencies: 'xvfb texlive-latex-extra latexmk nodejs npm'
5555

56-
doc-deploy:
57-
name: "Deploy development documentation"
58-
runs-on: ubuntu-latest
59-
if: ${{ github.ref == 'refs/heads/main' }}
60-
needs: doc-build
61-
steps:
62-
- name: "Deploy development documentation"
63-
uses: pyansys/actions/doc-deploy-dev@v3
64-
with:
65-
cname: ${{ env.CNAME }}
66-
token: ${{ secrets.GITHUB_TOKEN }}
67-
6856
release-github:
6957
name: "Release to GitHub"
7058
runs-on: ubuntu-latest
71-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
72-
needs: doc-deploy
59+
if: github.ref == 'refs/heads/main'
60+
needs: doc-build
7361
steps:
7462

7563
- name: "Download HTML documentation"
@@ -106,3 +94,17 @@ jobs:
10694
files: |
10795
documentation-html.zip
10896
documentation-pdf
97+
98+
doc-deploy:
99+
name: "Deploy documentation"
100+
runs-on: ubuntu-latest
101+
if: github.ref == 'refs/heads/main'
102+
needs: release-github
103+
steps:
104+
- uses: peaceiris/actions-gh-pages@v3
105+
with:
106+
github_token: ${{ secrets.GITHUB_TOKEN }}
107+
publish_dir: ./doc/_build/html
108+
cname: ${{ env.DOCUMENTATION_CNAME }}
109+
full_commit_message: ${{ github.event.head_commit.message }}
110+
force_orphan: true

.pre-commit-config.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ repos:
55
rev: 23.1.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
66
hooks:
77
- id: black
8-
args: ["doc/source/conf.py"]
8+
args: [
9+
"doc/source/conf.py",
10+
"examples"
11+
]
912

1013
- repo: https://github.com/adamchainz/blacken-docs
1114
rev: 1.13.0
@@ -29,10 +32,10 @@ repos:
2932
- id: flake8
3033

3134
- repo: https://github.com/codespell-project/codespell
32-
rev: v2.2.2
35+
rev: v2.2.1
3336
hooks:
3437
- id: codespell
35-
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]
38+
args: ["--ignore-words", "doc/styles/Vocab/ANSYS/accept.txt"]
3639

3740
- repo: https://github.com/pre-commit/pre-commit-hooks
3841
rev: v4.4.0

Makefile

Lines changed: 0 additions & 13 deletions
This file was deleted.

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
project = "PyAnsys Developer's Guide"
1818
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
1919
author = "Ansys Inc."
20-
release = version = "0.3.dev0"
20+
release = version = datetime.now().strftime("%Y-%m-%d")
2121

2222
html_logo = pyansys_logo_black
2323
html_theme = "ansys_sphinx_theme"

doc/styles/Vocab/ANSYS/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,4 @@ Muela
8585
Kaszynski
8686
cybersecurity
8787
substring
88+
parm

ignore_words.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@ deps =
3232
-r{toxinidir}/requirements/requirements_doc.txt
3333
allowlist_externals=*
3434
commands =
35-
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxworkdir}/doc_out_html" --color -vW -b html
36-
touch "{toxworkdir}/doc_out_html/.nojekyll"
37-
bash -c 'echo "dev.docs.pyansys.com" > "{toxworkdir}/doc_out_html/CNAME"'
35+
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxinidir}/doc/_build/html" --color -vW -b html

0 commit comments

Comments
 (0)