1- name : " GitHub Pages "
1+ name : " Build Docs "
22
33on :
4- push :
5- branches : ["master"]
6- workflow_dispatch :
7- repository_dispatch :
8- types :
9- - webhook
4+ workflow_call :
5+ inputs :
6+ name :
7+ description : " Artifact Name"
8+ type : string
9+ default : github-pages
10+ path :
11+ description : " Build Path"
12+ type : string
13+ default : site
14+
15+ env :
16+ logo : " https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/vultr-python/logo128.png"
17+ link : ${{ github.event.repository.html_url }}
1018
1119jobs :
1220 build :
@@ -16,51 +24,75 @@ jobs:
1624
1725 steps :
1826 - name : " Checkout"
19- uses : actions/checkout@v3
27+ uses : actions/checkout@v5
28+
29+ - name : " Debug CTX github"
30+ continue-on-error : true
31+ env :
32+ GITHUB_CTX : ${{ toJSON(github) }}
33+ run : echo "$GITHUB_CTX"
34+
35+ - name : " Debug"
36+ continue-on-error : true
37+ run : |
38+ echo "logo: ${{ env.logo }}"
39+ echo "link: ${{ env.link }}"
2040
21- - name : " Setup Python"
22- uses : actions/setup-python@v4
41+ - name : " Setup Python 3.13 "
42+ uses : actions/setup-python@v6
2343 with :
24- python-version : " 3.11"
44+ python-version : " 3.13"
45+ cache : " pip"
2546
2647 - name : " Build Docs"
2748 run : |
2849 python -m pip install -U pip
2950 python -m pip install -U pdoc
30- python -m pip install -Ur requirements.txt
31- python -m pdoc -o _site vultr.py
51+ python -m pip install -e .
52+ python -m pdoc -t docs -o "${{ inputs.path }}" \
53+ --favicon "${{ env.logo }}" \
54+ --logo "${{ env.logo }}" \
55+ --logo-link "${{ env.link }}" \
56+ vultr
3257
3358 - name : " Update Permissions"
3459 run : |
35- chmod -c -R +rX "_site/ " | while read line ; do
36- echo "::warning title=Invalid file permissions automatically fixed::$line "
60+ chmod -c -R +rX "${{ inputs.path }} " | while read name ; do
61+ echo "::notice::Fixed invalid file permissions: ${name} "
3762 done
3863
64+ - name : " List Artifacts"
65+ env :
66+ path : ${{ inputs.path }}
67+ run : |
68+ echo "::group::ls"
69+ ls -lAhR "${path}"
70+ echo "::endgroup::"
71+ echo "::group::tree"
72+ tree "${path}"
73+ echo "::endgroup::"
74+ results="$(tree "${path}")"
75+ markdown='Artifacts:\n```text\n'"${results}"'\n```'
76+ echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY
77+
3978 - name : " Upload Pages Artifact"
40- uses : actions/upload-pages-artifact@v2
79+ if : ${{ inputs.name == 'github-pages' }}
80+ uses : actions/upload-pages-artifact@v4
4181 with :
42- path : _site/
82+ path : ${{ inputs.path }}
4383
44- deploy :
45- name : " Deploy"
46- runs-on : ubuntu-latest
47- timeout-minutes : 5
48- needs : build
49-
50- permissions :
51- pages : write
52- id-token : write
53-
54- environment :
55- name : github-pages
56- url : ${{ steps.deployment.outputs.page_url }}
57-
58- steps :
59- - name : " Configure Pages"
60- uses : actions/configure-pages@v3
84+ - name : " Upload Artifact"
85+ if : ${{ inputs.name != 'github-pages' }}
86+ uses : actions/upload-artifact@v5
87+ with :
88+ name : ${{ inputs.name }}
89+ path : ${{ inputs.path }}
90+ if-no-files-found : " error"
91+ include-hidden-files : true
6192
62- - name : " Deploy Pages "
63- id : deployment
64- uses : actions/deploy-pages@v2
93+ - name : " Send Failure Notification "
94+ if : ${{ failure() }}
95+ uses : sarisia/actions-status-discord@v1
6596 with :
66- artifact_name : github-pages
97+ webhook : ${{ secrets.DISCORD_WEBHOOK }}
98+ description : ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
0 commit comments