Skip to content

Commit 44d9719

Browse files
ci: adding pr docs preview action (#4173)
* feat: add deployment step for PR documentation in CI workflow * feat: add PR documentation cleanup workflow for closed pull requests * chore: adding changelog file 4173.miscellaneous.md [dependabot-skip] * Update .github/workflows/ci.yml * Update .github/workflows/ci.yml * feat: add 'deploy pr docs' label and update CI workflow for PR documentation deployment --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 63a2755 commit 44d9719

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

.github/labels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,7 @@
150150
- name: build failed
151151
description: "Schedule build fails"
152152
color: E67E22
153+
154+
- name: 'deploy pr docs'
155+
description: Deploy pull request documentation
156+
color: 76D7C4

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,21 @@ jobs:
146146
license-server: ${{ secrets.LICENSE_SERVER }}
147147
username: ${{ github.actor }}
148148
password: ${{ secrets.GITHUB_TOKEN }}
149+
150+
151+
doc-deploy-pr:
152+
name: "Deploy PR documentation"
153+
runs-on: ubuntu-latest
154+
needs: docs-build
155+
if: contains(github.event.pull_request.labels.*.name, 'deploy pr docs')
156+
steps:
157+
- uses: ansys/actions/[email protected]
158+
with:
159+
cname: ${{ env.DOCUMENTATION_CNAME }}
160+
token: ${{ secrets.GITHUB_TOKEN }}
161+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
162+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
163+
maximum-pr-doc-deployments: 3
149164

150165

151166
build-test-remote-matrix:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This action cleans up the deployed documentation for pull requests
2+
# after they have been merged or closed.
3+
# The docs deployment is implemented in the main CICD file (`ci.yml`)
4+
# since it is in that workflow where the docs are built.
5+
#
6+
# For more information see:
7+
# https://actions.docs.ansys.com/version/stable/doc-actions/index.html#doc-deploy-pr-action
8+
9+
name: PR-docs cleaner
10+
11+
on:
12+
pull_request:
13+
types: [closed]
14+
15+
env:
16+
DOCUMENTATION_CNAME: 'mapdl.docs.pyansys.com'
17+
18+
jobs:
19+
clean-docs-pr:
20+
name: "Deploy PR documentation"
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: ansys/actions/[email protected]
24+
with:
25+
cname: ${{ env.DOCUMENTATION_CNAME }}
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
28+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
29+
maximum-pr-doc-deployments: 3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ci: adding pr docs preview action

0 commit comments

Comments
 (0)