-
Notifications
You must be signed in to change notification settings - Fork 9
137 lines (115 loc) · 3.46 KB
/
ci_cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
pull_request:
push:
tags:
- "*"
branches:
- main
env:
MAIN_PYTHON_VERSION: '3.12'
DOCUMENTATION_CNAME: 'dev.docs.pyansys.com'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
doc-style:
name: "Check documentation style"
runs-on: ubuntu-latest
steps:
- name: "Check documentation style"
uses: ansys/actions/doc-style@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
doc-build:
name: "Build project documentation"
runs-on: ubuntu-latest
steps:
- name: "Install mermaid-cli"
run: npm install -g @mermaid-js/mermaid-cli
- name: "Install GraphViz"
shell: bash
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: "Build project documentation"
uses: ansys/actions/doc-build@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
skip-install: true
requires-xvfb: true
dependencies: 'xvfb texlive-latex-extra latexmk nodejs npm'
doc-deploy:
name: "Deploy documentation"
runs-on: ubuntu-latest
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags')
needs: doc-build
steps:
- name: "Download HTML documentation artifacts"
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: documentation-html
cname: ${{ env.DOCUMENTATION_CNAME }}
full_commit_message: ${{ github.event.head_commit.message }}
force_orphan: true
release-github:
name: "Release to GitHub"
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: doc-build
steps:
- name: "Download HTML documentation"
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html
- name: "Zip HTML documentation"
uses: vimtor/action-zip@v1
with:
files: documentation-html
dest: documentation-html.zip
- name: "Download PDF documentation"
uses: actions/download-artifact@v4
with:
name: documentation-pdf
path: documentation-pdf
- name: "Zip PDF documentation"
uses: vimtor/action-zip@v1
with:
files: documentation-pdf
dest: documentation-pdf
- name: "Display the structure of downloaded files"
shell: bash
run: ls -R
- name: "Release to GitHub"
uses: softprops/action-gh-release@v2
with:
files: |
documentation-html.zip
documentation-pdf
doc-deploy-github-release:
name: "Deploy documentation (stable)"
runs-on: ubuntu-latest
needs: [release-github]
steps:
- name: "Download HTML documentation artifacts"
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: documentation-html
cname: ${{ env.DOCUMENTATION_CNAME }}
full_commit_message: ${{ github.event.head_commit.message }}
force_orphan: true