-
Notifications
You must be signed in to change notification settings - Fork 8
207 lines (175 loc) · 8 KB
/
documentation.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# #
# @type github workflow
# @desc builds mkdocs from the main branch /docs/ folder and puts the compiled version
# in the `gh-pages` branch. Is hosted using Github Pages.
#
# @update pip install --upgrade mkdocs
# pip install --upgrade --force-reinstall mkdocs-material
#
# @author Aetherinox
# @url https://github.com/Aetherinox
#
# @secrets secrets.SELF_TOKEN_CL Github Access Token (Classic)
# secrets.DISCORD_WEBHOOK_CHAN_GITHUB_TVAPP2_WORKfLOWS Discord Webbhook URL; right-click on channel, click "Integrations"
# #
name: "📒 Docs › Build"
run-name: "📒 Docs › Build"
# #
# triggers
# #
on:
release:
types:
- published
push:
paths:
- docs/**
workflow_dispatch:
schedule:
- cron: "0 */12 * * *"
# #
# environment variables
# #
env:
ASSIGN_USER: Aetherinox
BOT_NAME_1: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]
# #
# jobs
# #
jobs:
build-docs:
# runs-on: ubuntu-latest
runs-on: apollo-x64
timeout-minutes: 20
permissions:
contents: write
pages: write
environment:
name: Orion
steps:
# #
# Documentation › Checkout › Arm64
# #
- name: >-
✅ Checkout
id: task_docs_checkout
uses: actions/checkout@v4
# #
# Documentation › Set Env Variables
# #
- name: >-
🕛 Get Timestamp
id: task_docs_set_timestamp
run: |
echo "NOW=$(date +'%m-%d-%Y %H:%M:%S')" >> $GITHUB_ENV
echo "NOW_SHORT=$(date +'%m-%d-%Y')" >> $GITHUB_ENV
echo "NOW_LONG=$(date +'%m-%d-%Y %H:%M')" >> $GITHUB_ENV
echo "NOW_DOCKER_LABEL=$(date +'%Y%m%d')" >> $GITHUB_ENV
# #
# Documentation › Setup Python
# #
- name: "🐍 Setup Python"
id: task_docs_python_setup
uses: actions/setup-python@v5
with:
python-version: 3.x
# #
# Documentation › Build Documentation
# #
- name: >-
📕 Build Documentation
id: task_docs_build
run: |
export DOCS_NAME=${{ secrets.DOCS_NAME || 'TVApp2' }}
export DOCS_SECRET_L1=${{ secrets.DOCS_SECRET_L1 }}
export DOCS_SECRET_L2=${{ secrets.DOCS_SECRET_L2 }}
export GH_TOKEN=${{ secrets.ADMINSERV_TOKEN }}
pip install mkdocs
pip install mkdocs-material
pip install mike
pip install mkdocs-git-committers-plugin-2
pip install mkdocs-encryptcontent-plugin
pip install mkdocs-redirects mkdocs-glightbox pymdown-extensions mkdocs-git-revision-date-localized-plugin mkdocs-git-authors-plugin mkdocs-link-embeds-plugin
cd docs
mkdocs build
dir
env:
GH_TOKEN: ${{ secrets.ADMINSERV_TOKEN }}
# #
# Documentation › Deploy
# #
- name: "💽 Deploy"
id: task_docs_deploy
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.ADMINSERV_TOKEN_CL }}
publish_dir: ./docs/site
# #
# Documentation › Get Weekly Commits
# #
- name: >-
🕛 Get Weekly Commit List
id: task_docs_set_weekly_commit_list
run: |
echo 'WEEKLY_COMMITS<<EOF' >> $GITHUB_ENV
git log --format="[\`%h\`](${{ github.server_url }}/${{ github.repository }}/commit/%H) %s - %an" --since=7.days >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# #
# Documentation › Notify Github › Success
# #
- name: >-
🔔 Send Discord Webhook Message (Success)
id: task_docs_notify_discord_success
uses: tsickert/[email protected]
if: success()
with:
username: 'Io'
avatar-url: 'https://i.imgur.com/8BVDkla.jpg'
webhook-url: ${{ secrets.DISCORD_WEBHOOK_CHAN_GITHUB_TVAPP2_WORKfLOWS }}
embed-title: "⚙️ ${{ github.workflow_ref }}"
embed-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
embed-thumbnail-url: 'https://i.imgur.com/zDIzE8T.jpg'
embed-description: |
## 📦 Documentation Deployment${{ job.status == 'success' && '✅' || '❌' }}
A **successful** deployment of TVApp2 documentation has been completed. Changes to documentation will appear in the next 5 minutes.
- Documentation: https://thebinaryninja.github.io/tvapp2/
- Workflow: `${{ github.workflow }} (#${{github.run_number}})`
- Runner: `${{ runner.name }}`
- Triggered By: `${{ github.actor }}`
- Status: `${{ job.status == 'success' && '✅ Successful' || '❌ Failed' }}`
embed-color: ${{ job.status == 'success' && '5763719' || '15418782' }}
embed-footer-text: "Completed at ${{ env.NOW }} UTC"
embed-timestamp: "${{ env.NOW_LONG }}"
embed-author-name: "${{ github.repository_owner }}"
embed-author-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
embed-author-icon-url: "https://avatars.githubusercontent.com/u/200161462"
# #
# Documentation › Notify Github › Failure
# #
- name: >-
🔔 Send Discord Webhook Message (Failure)
id: task_docs_notify_discord_failure
uses: tsickert/[email protected]
if: failure()
with:
username: 'Io'
avatar-url: 'https://i.imgur.com/8BVDkla.jpg'
webhook-url: ${{ secrets.DISCORD_WEBHOOK_CHAN_GITHUB_TVAPP2_WORKfLOWS }}
embed-title: "⚙️ ${{ github.workflow_ref }}"
embed-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
embed-thumbnail-url: 'https://i.imgur.com/zDIzE8T.jpg'
embed-description: |
## 📦 Documentation Deployment${{ job.status == 'success' && '✅' || '❌' }}
A **failed** attempt to build the new documentation has triggered. No changes to your documentation will be made until the errors are fixed in the workflow.
- Documentation: https://thebinaryninja.github.io/tvapp2/
- Workflow: `${{ github.workflow }} (#${{github.run_number}})`
- Runner: `${{ runner.name }}`
- Triggered By: `${{ github.actor }}`
- Status: `${{ job.status == 'success' && '✅ Successful' || '❌ Failed' }}`
embed-color: ${{ job.status == 'success' && '5763719' || '15418782' }}
embed-footer-text: "Completed at ${{ env.NOW }} UTC"
embed-timestamp: "${{ env.NOW_LONG }}"
embed-author-name: "${{ github.repository_owner }}"
embed-author-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
embed-author-icon-url: "https://avatars.githubusercontent.com/u/200161462"