-
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (87 loc) · 2.84 KB
/
docs.yaml
File metadata and controls
102 lines (87 loc) · 2.84 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: "Build Docs"
on:
workflow_call:
inputs:
name:
description: "Artifact Name"
type: string
default: github-pages
path:
description: "Build Path"
type: string
default: site
env:
logo: "https://raw.githubusercontent.com/cssnr/vultr-python/refs/heads/master/.github/assets/logo.svg"
link: ${{ github.event.repository.html_url }}
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- name: "Checkout"
uses: actions/checkout@v6
- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"
- name: "Debug"
continue-on-error: true
run: |
echo "logo: ${{ env.logo }}"
echo "link: ${{ env.link }}"
- name: "Setup Python 3.13"
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: "pip"
- name: "Build Docs"
run: |
python -m pip install -U pip
python -m pip install --group dev
python -m pip install -U pdoc
#python -m pip install -e .
python -m pdoc -t docs -o "${{ inputs.path }}" \
--logo "${{ env.logo }}" \
--logo-link "${{ env.link }}" \
src/vultr
- name: "Fix Docs"
working-directory: ${{ inputs.path }}
run: |
mv -f vultr.html index.html
#- name: "Update Permissions"
# run: |
# chmod -c -R +rX "${{ inputs.path }}" | while read name; do
# echo "::notice::Fixed invalid file permissions: ${name}"
# done
- name: "List Artifacts"
working-directory: ${{ inputs.path }}
run: |
results="$(tree . || ls -lAhR .)"
echo "::group::results"
echo "${results}"
echo "::endgroup::"
markdown="Artifacts: \`${{ inputs.path }}\`\n\`\`\`text\n${results}\n\`\`\`"
echo -e "${markdown}" >> "$GITHUB_STEP_SUMMARY"
- name: "Upload Pages Artifact"
if: ${{ inputs.name == 'github-pages' }}
uses: actions/upload-pages-artifact@v4
with:
path: ${{ inputs.path }}
- name: "Upload Artifact"
if: ${{ inputs.name != 'github-pages' }}
uses: actions/upload-artifact@v5
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
if-no-files-found: "error"
include-hidden-files: true
- name: "Send Failure Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}