Skip to content

Commit 7b254ab

Browse files
committed
ApiGen + deploy to GitHub Pages
1 parent f440c76 commit 7b254ab

File tree

7 files changed

+1796
-0
lines changed

7 files changed

+1796
-0
lines changed

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.php text eol=lf
33

44
.github export-ignore
5+
apigen export-ignore
56
build-cs export-ignore
67
doc/grammars export-ignore
78
tests export-ignore

Diff for: .github/workflows/apiref.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Deploy API Reference"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "1.21.x"
10+
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: false
14+
15+
jobs:
16+
build:
17+
name: "Build API References Pages"
18+
runs-on: "ubuntu-latest"
19+
20+
steps:
21+
- name: "Checkout"
22+
uses: actions/checkout@v3
23+
24+
- name: "Install PHP"
25+
uses: "shivammathur/setup-php@v2"
26+
with:
27+
coverage: "none"
28+
php-version: "8.1"
29+
extensions: mbstring
30+
tools: composer:v2
31+
32+
- name: "Install dependencies"
33+
run: "composer update --no-interaction --no-progress"
34+
35+
- name: "Install ApiGen dependencies"
36+
working-directory: "apigen"
37+
run: "composer install --no-interaction --no-progress"
38+
39+
- name: "Run ApiGen"
40+
run: "apigen/vendor/bin/apigen -c apigen/apigen.neon --output docs -- src"
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v1
44+
with:
45+
path: 'docs'
46+
47+
deploy:
48+
needs: build
49+
50+
# from https://github.com/actions/deploy-pages
51+
52+
permissions:
53+
pages: write
54+
id-token: write
55+
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v2

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/docs
12
/temp
23
/tools
34
/tests/tmp

Diff for: apigen/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor

Diff for: apigen/apigen.neon

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
title: phpstan/phpdoc-parser

Diff for: apigen/composer.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"require": {
3+
"apigen/apigen": "^7.0.0"
4+
},
5+
"minimum-stability": "dev"
6+
}

0 commit comments

Comments
 (0)