Skip to content

Commit 388634f

Browse files
authored
switch to PHIVE
1 parent 246702b commit 388634f

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

.github/workflows/publish-apidocs.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# Generate API docs and publish to GitHub Pages at phpdoc.moodledev.io
66
#
77
# How it works:
8-
# - Get Moodle code into .moodle
9-
# - Build docs into .docs
8+
# - Get Moodle code into ./source
9+
# - Build docs into ./docs
10+
# - Cache to ./phpdoc-cache
1011
# - Publish that to phpdoc.moodledev.io
1112

1213
name: Generate phpdoc.moodledev.io
@@ -43,7 +44,7 @@ jobs:
4344
uses: actions/checkout@v4
4445
with:
4546
repository: moodle/moodle
46-
path: .moodle
47+
path: source
4748

4849
#NOT USING NODE
4950
#TODO: remove commented out lines
@@ -52,22 +53,44 @@ jobs:
5253
# with:
5354
# node-version-file: '.moodle/.nvmrc'
5455

56+
# Install phpDocumentator using PHIVE
57+
# phpDocumentator recommends PHIVE as the preferred install strategy
58+
# Source: https://github.com/phpDocumentor/phpDocumentor/blob/919d5c1ef42a3c74d050e05ce99add6efa87b5a4/README.md?plain=1#L79
59+
- name: Cache PHIVE tools
60+
uses: actions/cache@v4
61+
with:
62+
path: ${{ runner.temp }}/.phive
63+
key: php-phive-${{ hashFiles('.phive/phars.xml') }}
64+
restore-keys: php-phive-
65+
66+
- name: Install PHIVE
67+
uses: szepeviktor/phive@v1
68+
with:
69+
home: ${{ runner.temp }}/.phive
70+
binPath: ${{ github.workspace }}/tools/phive
71+
72+
# TODO: add phpDocumentator's GPG key here as a --trust-gpg-keys
73+
# Blocker: https://github.com/phpDocumentor/phpDocumentor/issues/3694
74+
# Maybe: specify a stable major branch of phpDocumentor to install rather than always getting latest release
75+
- name: Install phpDocumentor
76+
run: ${{ github.workspace }}/tools/phive install phpDocumentor
77+
5578
- name: Cache phpDocumentor build files
5679
id: phpdocumentor-cache
5780
uses: actions/cache@v4
5881
with:
59-
path: .phpdoc/cache
82+
path: phpdoc-cache
6083
key: ${{ runner.os }}-phpdocumentor-${{ github.sha }}
6184
restore-keys: ${{ runner.os }}-phpdocumentor-
6285

6386
# TODO: remove the ignores below, they speed up the runs for quick evaluation while we're setting this up
6487
- name: Build with phpDocumentor
65-
run: docker run --rm --volume "$(pwd):/data" phpdoc/phpdoc:3 -vv -d .moodle --target .docs --cache-folder .phpdoc/cache --template default --ignore .moodle/libs --ignore .moodle/admin --ignore .moodle/mod --ignore .moodle/blocks
88+
run: ${{ github.workspace }}/tools/phpDocumentor -vv -d source --target docs --cache-folder phpdoc-cache --template default --ignore source/libs --ignore source/admin --ignore source/mod --ignore source/blocks
6689

6790
- name: Upload artifact to GitHub Pages
6891
uses: actions/upload-pages-artifact@v3
6992
with:
70-
path: .docs
93+
path: docs
7194

7295
deploy:
7396
needs: build

0 commit comments

Comments
 (0)