Skip to content

Commit 5648153

Browse files
committed
updating 5.4 for gh-pages
1 parent e6a4019 commit 5648153

File tree

3 files changed

+107
-37
lines changed

3 files changed

+107
-37
lines changed

.github/workflows/deploy-documents.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Workflow inspiration and adaptation came from Andruino-Cli
2+
# https://github.com/arduino/arduino-cli/blob/master/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
3+
14
name: Deploy Documents 5.4
25

36
env:
@@ -6,7 +9,7 @@ env:
69
on:
710
push:
811
branches:
9-
# Branch to base "dev" website on. Set in siteversion.py also.
12+
# Branch to base "dev" website on.
1013
- master
1114
# Release branches have names like 0.8.x, 0.9.x, ...
1215
- "[0-9]+.[0-9]+.x"
@@ -50,37 +53,56 @@ jobs:
5053
python -m pip install --upgrade pip
5154
python -m pip install -r requirements.txt
5255
53-
# - name: Create all generated documentation content
54-
# run: mkdocs build
55-
#
56+
- name: Get sponsors and fanart
57+
run: |
58+
wget -O docs/assets/sponsors.md \
59+
https://raw.githubusercontent.com/phalcon/assets/master/phalcon/sponsors-fragment.html
60+
wget -O overrides/fanart.md \
61+
https://raw.githubusercontent.com/phalcon/assets/master/phalcon/fanart-fragment.html
62+
63+
- name: Update NFR list
64+
run: |
65+
python ./update-nfr.py
66+
5667
- name: Determine versioning parameters
5768
id: determine-versioning
5869
run: |
5970
# Read the first line from the VERSION file
6071
LINE=$(head -n 1 ./VERSION)
61-
72+
6273
# Extract version and alias using parameter expansion
6374
VERSION="${LINE%%|*}"
6475
ALIAS="${LINE#*|}"
65-
76+
6677
# Print the extracted values for verification
6778
echo "Version: $VERSION"
6879
echo "Alias: $ALIAS"
69-
80+
7081
echo "PH_DOCS_VERSION=$VERSION" >> $GITHUB_ENV
7182
echo "PH_DOCS_ALIAS=$ALIAS" >> $GITHUB_ENV
7283
7384
- name: Deploy
7485
if: ${{ env.PH_DOCS_VERSION }} != null
7586
run: |
76-
# Publishing implies creating a git commit on the production branch,
77-
# we let @phalconbot own these commits.
87+
# Publishing implies creating a git commit on the production branch,
88+
# We will need to create a user for this at some point
89+
echo "Deploying with Mike"
7890
git config user.name niden
7991
git config user.email [email protected]
80-
git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production
92+
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
8193
mike deploy \
8294
--update-aliases \
83-
--branch production \
95+
--alias-type=redirect \
8496
--push \
8597
${{ env.PH_DOCS_VERSION }} \
8698
${{ env.PH_DOCS_ALIAS }}
99+
echo "Deployed"
100+
101+
# git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production
102+
# mike deploy \
103+
# --update-aliases \
104+
# --alias-type=redirect \
105+
## --branch production \
106+
# --push \
107+
# ${{ env.PH_DOCS_VERSION }} \
108+
# ${{ env.PH_DOCS_ALIAS }}

mkdocs.yml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ plugins:
176176
'en/index.md': introduction.md
177177
'en/installation.md': installation.md
178178
'en/introduction.md': introduction.md
179-
'en/latest/index.md': introduction.md
180179
'en/logger.md': logger.md
181180
'en/mvc.md': mvc.md
182181
'en/mvc-url.md': mvc-url.md
@@ -221,7 +220,6 @@ plugins:
221220
# Additional configuration
222221
extra:
223222
version:
224-
default: 5.4.0
225223
provider: mike
226224
analytics:
227225
provider: google
@@ -296,31 +294,31 @@ nav:
296294
- Home:
297295
- Introduction: introduction.md
298296
- Changelog:
299-
- Current Version: https://github.com/phalcon/cphalcon/blob/5.0.x/CHANGELOG-5.0.md
300-
- Releases: releases.md
301-
- How to upgrade: upgrade.md
297+
- Current Version: https://github.com/phalcon/cphalcon/blob/5.0.x/CHANGELOG-5.0.md
298+
- Releases: releases.md
299+
- How to upgrade: upgrade.md
302300
- Contributing:
303-
- Contributions: contributions.md
304-
- Asking a question: https://phalcon.io/discussions
305-
- Requesting a change: new-feature-request.md
306-
- Issuing a Pull Request: new-pull-request.md
301+
- Contributions: contributions.md
302+
- Asking a question: https://phalcon.io/discussions
303+
- Requesting a change: new-feature-request.md
304+
- Issuing a Pull Request: new-pull-request.md
307305
- Guides:
308-
- Backtrace Generation: generating-backtrace.md
309-
- Reproducible Tests: reproducible-tests.md
310-
- Testing environment: testing-environment.md
311-
- Coding Standard: coding-standard.md
306+
- Backtrace Generation: generating-backtrace.md
307+
- Reproducible Tests: reproducible-tests.md
308+
- Testing environment: testing-environment.md
309+
- Coding Standard: coding-standard.md
312310
- Sponsoring: sponsors.md
313311
- Getting Started:
314312
- Installation: installation.md
315313
- Webserver Setup: webserver-setup.md
316314
- Environments:
317-
- Devilbox: environments-devilbox.md
318-
- Nanobox: environments-nanobox.md
315+
- Devilbox: environments-devilbox.md
316+
- Nanobox: environments-nanobox.md
319317
- Development Tools:
320-
- Devtools: devtools.md
321-
- Debug: support-debug.md
322-
- Migrations: db-migrations.md
323-
- Unit Testing: unit-testing.md
318+
- Devtools: devtools.md
319+
- Debug: support-debug.md
320+
- Migrations: db-migrations.md
321+
- Unit Testing: unit-testing.md
324322
- Tutorials:
325323
- Basic: tutorial-basic.md
326324
- Invo: tutorial-invo.md
@@ -335,7 +333,6 @@ nav:
335333
- DI Container: di.md
336334
- MVC: mvc.md
337335
- Namespaces: namespaces.md
338-
- API Index: api/index.md
339336
- Database:
340337
- Layer: db-layer.md
341338
- PHQL: db-phql.md
@@ -357,11 +354,11 @@ nav:
357354
- Forms: forms.md
358355
- Image: image.md
359356
- HTML:
360-
- Attributes: html-attributes.md
361-
- Breadcrumbs: html-breadcrumbs.md
362-
- Escaper: html-escaper.md
363-
- Link: html-link.md
364-
- Tag Factory: html-tagfactory.md
357+
- Attributes: html-attributes.md
358+
- Breadcrumbs: html-breadcrumbs.md
359+
- Escaper: html-escaper.md
360+
- Link: html-link.md
361+
- Tag Factory: html-tagfactory.md
365362
- Tag (legacy): tag.md
366363
- View: views.md
367364
- Volt: volt.md
@@ -383,7 +380,7 @@ nav:
383380
- Loader: autoload.md
384381
- Logger: logger.md
385382
- HTTP:
386-
- Cookies: response/#cookies
383+
- Cookies: response#cookies
387384
- Request: request.md
388385
- Response: response.md
389386
- i18n:
@@ -401,6 +398,7 @@ nav:
401398
- Helper: support-helper.md
402399
- Registry: support-registry.md
403400
- Version: support-version.md
401+
- API: api/index.md
404402
- Discussions: https://github.com/orgs/phalcon/discussions
405403
- Discussions(v6): https://github.com/phalcon/phalcon/discussions
406404
- Blog: https://blog.phalcon.io/

update-nfr.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import requests
2+
import json
3+
4+
print("Getting NFR Reactions")
5+
6+
comments = 'https://api.github.com/repos/phalcon/cphalcon/issues/14608/comments?page='
7+
result = {}
8+
for i in range(1, 10):
9+
url = f"{comments}{i}"
10+
headers = {
11+
'Accept': 'application/vnd.github.squirrel-girl-preview+json',
12+
'User-Agent': 'Phalcon Agent'
13+
}
14+
15+
response = requests.get(url, headers=headers)
16+
content = response.text
17+
18+
print(f"Got content {i}")
19+
data = json.loads(content)
20+
21+
for comment in data:
22+
id = comment.get('id', '')
23+
url = comment.get('html_url', '')
24+
body = comment.get('body', '')
25+
reactions = comment.get('reactions', {})
26+
plusone = reactions.get('+1', 0)
27+
28+
body = body.split('\n')[0].replace('\r', '').replace('\r\n', '')
29+
plusone = f"{int(plusone):03}"
30+
result[f"{plusone}-{id}"] = {
31+
'reaction': plusone,
32+
'body': f"[{body}]({url})"
33+
}
34+
35+
print("Sorting Results")
36+
sorted_result = dict(sorted(result.items(), key=lambda item: item[0], reverse=True))
37+
38+
print("Creating Content")
39+
output = "# New Feature Request List\n"
40+
output += "- - -\n\n"
41+
output += "| Votes | Description |\n"
42+
output += "|--------|-------------------------|\n"
43+
for item in sorted_result.values():
44+
output += f"| {item['reaction']} | {item['body']} |\n"
45+
46+
output += "\n"
47+
48+
file_name = 'docs/new-feature-request-list.md'
49+
with open(file_name, 'w') as file:
50+
file.write(output)

0 commit comments

Comments
 (0)