-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.24 KB
/
python-app.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
90
name: Daily Plugin Processing
on:
schedule:
- cron: '0 15 * * 2,5' # Run every Tuesday and Friday at 15:00 UTC
push:
branches:
- main
pull_request:
branches:
- main
create:
tags:
- '*'
workflow_dispatch:
permissions:
contents: write # Allows the action to push changes
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Clean repository
run: |
find . -maxdepth 1 -mindepth 1 ! -name '_parse_plugins' ! -name '.*' -exec rm -rf {} +
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests jinja2
- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Clone and Install Pyxu repository
run: |
git clone https://github.com/pyxu-org/pyxu.git
cd pyxu
git fetch --tags
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latest_tag
python -m pip install .[dev]
cd ../
- name: Clean pyxu/doc/fair directory
run: |
rm -rf pyxu/doc/fair/plugins/*.rst
- name: Run parse_pypi.py
run: python _parse_plugins/parse_pypi.py
- name: Run make_pages.py
run: python _parse_plugins/make_pages.py
- name: Build HTML documentation
run: |
export TZ=UTC
sphinx-build -b html -j auto -w build/html/WARNINGS.log pyxu/doc/ pyxu/build/html/
- name: Remove Pyxu repository
run: |
mv pyxu/build/html/* ./
rm -rf pyxu
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m "Update generated HTML files [skip ci]"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
run: |
git push "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}