Skip to content

Commit d1ed7a3

Browse files
committed
updating 4.2 for gh-pages
1 parent ca9ddd2 commit d1ed7a3

File tree

3 files changed

+102
-32
lines changed

3 files changed

+102
-32
lines changed

.github/workflows/deploy-documents.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
name: Deploy Documents 4.2
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+
4+
name: Deploy Documents 5.8
25

36
env:
47
PYTHON_VERSION: "3.9"
58

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: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,6 @@ plugins:
23862386
# Additional configuration
23872387
extra:
23882388
version:
2389-
default: 5.4.0
23902389
provider: mike
23912390
analytics:
23922391
provider: google
@@ -2461,31 +2460,31 @@ nav:
24612460
- Home:
24622461
- Introduction: introduction.md
24632462
- Changelog:
2464-
- Current Version: https://github.com/phalcon/cphalcon/tree/master/resources
2465-
- Releases: releases.md
2466-
- How to upgrade: upgrade.md
2463+
- Current Version: https://github.com/phalcon/cphalcon/blob/5.0.x/CHANGELOG-5.0.md
2464+
- Releases: releases.md
2465+
- How to upgrade: upgrade.md
24672466
- Contributing:
2468-
- Contributions: contributions.md
2469-
- Asking a question: https://phalcon.io/discussions
2470-
- Requesting a change: new-feature-request.md
2471-
- Issuing a Pull Request: new-pull-request.md
2467+
- Contributions: contributions.md
2468+
- Asking a question: https://phalcon.io/discussions
2469+
- Requesting a change: new-feature-request.md
2470+
- Issuing a Pull Request: new-pull-request.md
24722471
- Guides:
2473-
- Backtrace Generation: generating-backtrace.md
2474-
- Reproducible Tests: reproducible-tests.md
2475-
- Testing environment: testing-environment.md
2476-
- Coding Standard: coding-standard.md
2472+
- Backtrace Generation: generating-backtrace.md
2473+
- Reproducible Tests: reproducible-tests.md
2474+
- Testing environment: testing-environment.md
2475+
- Coding Standard: coding-standard.md
24772476
- Sponsoring: sponsors.md
24782477
- Getting Started:
24792478
- Installation: installation.md
24802479
- Webserver Setup: webserver-setup.md
24812480
- Environments:
2482-
- Devilbox: environments-devilbox.md
2483-
- Nanobox: environments-nanobox.md
2481+
- Devilbox: environments-devilbox.md
2482+
- Nanobox: environments-nanobox.md
24842483
- Development Tools:
2485-
- Devtools: devtools.md
2486-
- Debug: debug.md
2487-
- Migrations: db-migrations.md
2488-
- Unit Testing: unit-testing.md
2484+
- Devtools: devtools.md
2485+
- Debug: support-debug.md
2486+
- Migrations: db-migrations.md
2487+
- Unit Testing: unit-testing.md
24892488
- Tutorials:
24902489
- Basic: tutorial-basic.md
24912490
- Invo: tutorial-invo.md
@@ -2500,7 +2499,6 @@ nav:
25002499
- DI Container: di.md
25012500
- MVC: mvc.md
25022501
- Namespaces: namespaces.md
2503-
- API Index: api/index.md
25042502
- Database:
25052503
- Layer: db-layer.md
25062504
- PHQL: db-phql.md
@@ -2571,4 +2569,4 @@ nav:
25712569
- Registry: registry.md
25722570
- Discussions: https://github.com/orgs/phalcon/discussions
25732571
- Discussions(v6): https://github.com/phalcon/phalcon/discussions
2574-
- Blog: https://blog.phalcon.io/
2572+
- 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)