@@ -20,73 +20,32 @@ jobs:
2020 id-token : write
2121 secrets : inherit
2222
23- docs-generate-site :
24- runs-on : ubuntu-latest
25- needs : ci
26- permissions :
27- contents : read
28- steps :
29- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30- with :
31- persist-credentials : false
32-
33- - run : |
34- mkdir -p ./_site
35-
36- echo -e "theme: jekyll-theme-cayman" > ./_site/_config.yml
37-
38- to_title_case() {
39- echo "$1" | awk '{
40- for (i=1; i<=NF; i++) {
41- $i = toupper(substr($i, 1, 1)) tolower(substr($i, 2))
42- }
43- print
44- }'
45- }
46-
47- create_site_page() {
48- page="$1"
49- title="$(to_title_case "$2")"
50- content_path="$3"
51- echo -e "---\nlayout: default\ntitle: $title\n---\n" > "$page"
52- echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" "$content_path")" >> "$page"
53- }
54-
55- create_site_page "./_site/index.md" "Home" "./README.md"
56-
57- for filepath in ./docs/*.md; do
58- filename=$(basename -- "$filepath")
59- section="${filename%.*}"
60- mkdir -p "./_site/$section"
61- create_site_page "./_site/$section/index.md" "$section" "$filepath"
62- done
63-
64- - uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
65- with :
66- name : docs-site
67- path : ./_site
68-
6923 docs-generate-phpdoc :
7024 runs-on : ubuntu-latest
7125 needs : ci
72- permissions :
73- contents : read
26+ container : phpdoc/phpdoc:3
27+ env :
28+ ARTIFACT_PATH : ./_site
29+ outputs :
30+ artifact-id : ${{ steps.upload-artifact.outputs.artifact-id }}
31+ artifact-path : ${{ env.ARTIFACT_PATH }}
7432 steps :
7533 - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
7634 with :
7735 persist-credentials : false
7836
7937 - name : 📃 Generate PHP documentation
80- run : docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 - d ./src -t ./_site /phpdoc
38+ run : phpdoc run -d ./src -t $ARTIFACT_PATH /phpdoc
8139
8240 - uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
41+ id : upload-artifact
8342 with :
8443 name : docs-phpdoc
85- path : ./_site
44+ path : ${{ env.ARTIFACT_PATH }}
8645
8746 docs-publish :
8847 name : Publish documentation
89- needs : [ docs-generate-site, docs-generate- phpdoc]
48+ needs : docs-generate-phpdoc
9049 runs-on : ubuntu-latest
9150 permissions :
9251 pages : write
@@ -95,24 +54,23 @@ jobs:
9554 name : github-pages
9655 url : ${{ steps.deployment.outputs.page_url }}
9756 steps :
98- - uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 .0.0
57+ - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 .0.1
9958 with :
100- pattern : " docs-*"
101- path : ./
102- merge-multiple : true
103-
104- - name : ⚙️ Setup Pages
105- uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
59+ persist-credentials : false
10660
107- - name : Build with Jekyll
108- uses : actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
61+ - uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
10962 with :
110- source : ./
111- destination : ./_site
63+ artifact-ids : ${{ needs.docs-generate-phpdoc.outputs.artifact-id }}
64+ path : ${{ needs.docs-generate-phpdoc.outputs.artifact-path }}
11265
113- - name : Upload artifact
114- uses : actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
66+ - uses : hoverkraft-tech/ci-github-publish/actions/deploy/jekyll@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1
67+ id : build
68+ with :
69+ site-path : ${{ needs.docs-generate-phpdoc.outputs.artifact-path }}
70+ pages : |
71+ ./docs/*.md
11572
116- - name : 🚀 Deploy to GitHub Pages
73+ - uses : hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@84e8ace407055e7a40ba6670a8c697e1ce2dfafa # 0.20.1
11774 id : deployment
118- uses : actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
75+ with :
76+ build-path : ${{ steps.build.outputs.build-path }}
0 commit comments