-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.62 KB
/
Copy pathdocs.yml
File metadata and controls
54 lines (46 loc) · 1.62 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
name: Build Docs
on:
release:
types: [published]
workflow_dispatch:
push:
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
# A published release, a manual dispatch, or a push whose head commit message
# contains "build docs" - the convention DiscordPHP uses, so the site is not
# rebuilt and redeployed on every commit.
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
tools: composer
# The DiscordPHP family's build of phpDocumentor, carrying its patches for
# `?T|null` types. Not on Packagist, hence the explicit repository.
- name: Install phpDocumentor
run: >-
composer create-project discord-php/phpdoc-tool:^1.0 phpdoc-tool
--no-interaction --no-progress
--repository='{"type":"vcs","url":"https://github.com/discord-php/phpdoc-tool"}'
- name: Build the reference
run: php tools/build-docs.php
- name: Disable Jekyll
# Without this, GitHub Pages hides every path beginning with an underscore.
run: touch build/.nojekyll
- name: Publish to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build
clean: true