forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.76 KB
/
docs.yaml
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
name: Build and Deploy Documentation
on:
push:
branches:
- develop
- feature/*
- main/*
- bugfix/*
- release/*
paths:
- docs/**
pull_request_target:
types: [issues, opened, reopened, synchronize]
paths:
- docs/**
jobs:
documentation:
permissions:
pull-requests: 'write'
runs-on: ubuntu-latest
name: Build and deploy documentation
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install (upgrade) python dependencies
run: |
pip install --upgrade pip sphinx sphinx-gallery sphinx_rtd_theme sphinxcontrib-bibtex
- name: Checkout
uses: actions/checkout@v3
- name: Build documentation
run: |
./.github/scripts/build_docs.sh
- name: Upload documentation (on success)
uses: actions/upload-artifact@v3
if: always()
with:
name: documentation
path: artifact/documentation
- name: Upload warnings (on failure)
uses: actions/upload-artifact@v3
if: failure()
with:
name: documentation_warnings.log
path: artifact/doc_warnings.log
if-no-files-found: ignore
- name: Comment ReadDocs
uses: actions/github-script@v6
with:
script: |
const message = `
Link to ReadTheDocs sample build for this PR can be found at:
https://global-workflow--${{ github.event.pull_request.number }}.org.readthedocs.build/en/${{ github.event.pull_request.number }}
`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
})