Repository navigation
55 lines (46 loc) · 1.63 KB
/
Copy pathdocs.yml
File metadata and controls
55 lines (46 loc) · 1.63 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
name: Build Docs
on:
release:
types: [published]
workflow_dispatch:
push:
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
# Runs on a published release, a manual dispatch, or a push whose head
# commit message contains "build docs" (matching DiscordPHP's convention).
if: >-
github.event_name == 'release'
|| github.event_name == 'workflow_dispatch'
|| (github.event_name == 'push' && contains(github.event.head_commit.message, 'build docs'))
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: iconv, mbstring
- name: Install phpDocumentor
run: |
curl --fail --location --output phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.10.0/phpDocumentor.phar
echo 'fe1e7c23ba3329aa6f19ac3c807446159a431a195ec5d9163b0c281a15105207 phpDocumentor.phar' | sha256sum --check
- name: Build class reference
run: php phpDocumentor.phar --config phpdoc.dist.xml --no-interaction
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Validate links, search and source provenance
run: |
node scripts/docs/finalize.mjs
node scripts/docs/verify.mjs "${{ github.sha }}"
- name: Publish to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/v5
target-folder: v5
clean: true