This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (71 loc) · 2.19 KB
/
MainJob.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
name: MainJob
on:
push:
branches:
- 'main'
paths-ignore:
- '.github\workflows\**.*'
# schedule:
# - cron: '00 0 * * *'
jobs:
updater:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Setting Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Installing Dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install mkdocs
pip install mkdocs-material
pip install Pygments
sudo apt install cloc
- name: Pre-Configuring Git
run: |
git config user.name github-workflow
git config user.email [email protected]
git config --global http.postBuffer 1048576000
- name: Upgrading Packages
continue-on-error: true
# Thanks To https://stackoverflow.com/questions/2720014/how-to-upgrade-all-python-packages-with-pip
run: |
pip --disable-pip-version-check list --outdated --format=json | python -c "import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))"
- name: Building Documentation
continue-on-error: true
run: |
mkdocs build --config-file Documentation/mkdocs.yml
- name: Running Main Python Script
continue-on-error: true
run: |
python .github/workflows/Main.py
- name: Cleaning PYCACHE
continue-on-error: true
run: |
cd .github/workflows/
sudo find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
cd ../..
- name: Deploying Documentation
continue-on-error: true
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: Documentation/site
publish_branch: documentation
- name: Sites Cleanup
continue-on-error: true
run: |
rm -r Documentation/site
- name: Pushing Changes
continue-on-error: true
run: |
git add .
git commit -m "<Updated File>"
git push