Skip to content

Commit c8c807f

Browse files
committed
updating 3.4 for gh-pages
1 parent 8dce33f commit c8c807f

File tree

3 files changed

+99
-25
lines changed

3 files changed

+99
-25
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
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: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,6 @@ plugins:
20702070
# Additional configuration
20712071
extra:
20722072
version:
2073-
default: 5.4.0
20742073
provider: mike
20752074
analytics:
20762075
provider: google
@@ -2145,27 +2144,31 @@ nav:
21452144
- Home:
21462145
- Introduction: introduction.md
21472146
- Changelog:
2148-
- Current Version: https://github.com/phalcon/cphalcon/tree/master/resources
2147+
- Current Version: https://github.com/phalcon/cphalcon/blob/5.0.x/CHANGELOG-5.0.md
2148+
- Releases: releases.md
2149+
- How to upgrade: upgrade.md
21492150
- Contributing:
2150-
- Contributions: contributions.md
2151-
- Asking a question: https://phalcon.io/discussions
2152-
- Requesting a change: new-feature-request.md
2153-
- Issuing a Pull Request: new-pull-request.md
2151+
- Contributions: contributions.md
2152+
- Asking a question: https://phalcon.io/discussions
2153+
- Requesting a change: new-feature-request.md
2154+
- Issuing a Pull Request: new-pull-request.md
21542155
- Guides:
2155-
- Backtrace Generation: generating-backtrace.md
2156-
- Reproducible Tests: reproducible-tests.md
2156+
- Backtrace Generation: generating-backtrace.md
2157+
- Reproducible Tests: reproducible-tests.md
2158+
- Testing environment: testing-environment.md
2159+
- Coding Standard: coding-standard.md
21572160
- Sponsoring: sponsors.md
21582161
- Getting Started:
21592162
- Installation: installation.md
21602163
- Webserver Setup: webserver-setup.md
21612164
- WAMP: webserver-wamp.md
21622165
- XAMPP: webserver-xampp.md
21632166
- Environments:
2164-
- Nanobox: environments-nanobox.md
2167+
- Nanobox: environments-nanobox.md
21652168
- Development Tools:
2166-
- Installation: devtools-installation.md
2167-
- Usage: devtools-usage.md
2168-
- Debug: debug.md
2169+
- Installation: devtools-installation.md
2170+
- Usage: devtools-usage.md
2171+
- Debug: debug.md
21692172
- Tutorials:
21702173
- Basic: tutorial-basic.md
21712174
- Invo: tutorial-invo.md
@@ -2179,7 +2182,6 @@ nav:
21792182
- DI Container: di.md
21802183
- MVC: mvc.md
21812184
- Namespaces: namespaces.md
2182-
- API Index: api/index.md
21832185
- Database:
21842186
- Layer: db-layer.md
21852187
- PHQL: db-phql.md

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)