Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 'github-pages.yaml' Workflow - Fix several warnings & enable Caching pip packages #2539

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ updates:
ignore:
- dependency-name: "actions/stale"
versions: '>= 9'
- dependency-name: "actions/setup-python"
versions: '> 4'
Comment on lines -10 to -11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read this review comment to understand why I've removed this Dependabot Rule.

30 changes: 18 additions & 12 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
name: GitHub Pages Deploy

on:
release:
types: [published, prereleased]
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Checkout Repository
uses: actions/checkout@v4
with:
python-version: 3.x
- uses: actions/cache@v4
fetch-depth: '0' # Fetch all commit history for all branches as well as tags.

- name: Setup Python
uses: actions/setup-python@v5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason behind upgrading actions/setup-python to v5 is pretty simple.. it just works after upgrading this action, and I can confirm this after testing it in a new branch.

I've branched-out & committed/pushed a very simple commit, which even after deleting the branch, still exists thanks to GitHub having everything stay even after "Deleting" it, which's an awesome feature for some people.. but somewhat terrifying to others, but nonetheless.. it does work & produces no errors/fails to build & deploy the docs website, link to the run.

with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: pip install pillow cairosvg
- run: pip install mkdocs-awesome-pages-plugin
- run: pip install mkdocs-git-revision-date-localized-plugin
- run: pip install mkdocs-minify-plugin
- run: mkdocs gh-deploy --force
python-version: 3.x # Install latest Stable release of Python 3
cache: 'pip' # caching pip dependencies

- name: Install Necessary Dependencies using 'pip install -r requirements.txt'
run: pip install -r requirements.txt

- name: Build & Deploy using 'mkdocs'
run: mkdocs gh-deploy --force
51 changes: 51 additions & 0 deletions requirements.txt
Copy link
Contributor Author

@og-mrk og-mrk Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying each and every dependency & sub-dependency (and even sub-sub-dependency) is a great thing IMO, as not only does it show what we install.. but also what VERSION we should be using. Of course this's mainly used as a setup file. You run pip install -r requirements.txt, and you're off to the races!

If you want to update or add a new package (which may or may not require dependencies).. you can search online on how to properly update this file, I've done it with the most simple & straight forward way.. which's uninstalling every package, clearing the cache, and then install the packages required to build & deploy the docs website, see PR description for more details on the steps, and which "main" packages I've installed, which'll generate a similar list like the one below.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Babel==2.15.0
bracex==2.5
cairocffi==1.7.1
CairoSVG==2.7.1
certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
csscompressor==0.9.5
cssselect2==0.7.0
defusedxml==0.7.1
ghp-import==2.1.0
gitdb==4.0.11
GitPython==3.1.43
htmlmin2==0.1.13
idna==3.7
Jinja2==3.1.4
jsmin==3.0.1
Markdown==3.6
MarkupSafe==2.1.5
mergedeep==1.3.4
mkdocs==1.6.0
mkdocs-awesome-pages-plugin==2.9.3
mkdocs-get-deps==0.2.0
mkdocs-git-revision-date-localized-plugin==1.2.6
mkdocs-material==9.5.31
mkdocs-material-extensions==1.3.1
mkdocs-minify-plugin==0.8.0
natsort==8.4.0
packaging==24.1
paginate==0.5.6
pathspec==0.12.1
pillow==10.4.0
platformdirs==4.2.2
pycparser==2.22
Pygments==2.18.0
pymdown-extensions==10.9
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.2
pyyaml_env_tag==0.1
regex==2024.7.24
requests==2.32.3
six==1.16.0
smmap==5.0.1
tinycss2==1.3.0
urllib3==2.2.2
watchdog==4.0.1
wcmatch==9.0
webencodings==0.5.1