-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (57 loc) · 1.72 KB
/
Copy pathdocs.yml
File metadata and controls
69 lines (57 loc) · 1.72 KB
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
---
name: Generate and Deploy Documentation
on:
push:
branches:
- main
pull_request:
paths:
- "src/**"
- "docs/**"
- "README.md"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: 3.11
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
coverage: none
- name: Install MkDocs dependencies
run: |
pip install mkdocs==1.5.3 mkdocs-material pymdown-extensions mkdocs-minify-plugin
- name: Download phpDocumentor
run: |
curl -fsSL \
-o /tmp/phpDocumentor.phar \
https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.10.0/phpDocumentor.phar
echo "fe1e7c23ba3329aa6f19ac3c807446159a431a195ec5d9163b0c281a15105207 /tmp/phpDocumentor.phar" \
| sha256sum --check --strict
- name: Build MkDocs site
run: mkdocs build
- name: Build generated PHP API documentation
run: |
php /tmp/phpDocumentor.phar \
-d src \
-t site/api-docs \
--title "ELP Parser API"
- name: Verify generated documentation
run: |
test -f site/index.html
test -f site/api-docs/index.html
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site