-
-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (66 loc) · 2.13 KB
/
gen-docs.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
name: Generate Blocks Json
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
concurrency:
group: docs-ci-${{ github.ref }}
cancel-in-progress: true
env:
LOGURU_LEVEL: DEBUG
REMID: ${{ secrets.REMID }}
SID: ${{ secrets.SID }}
PYTHON_VERSION: '3.11'
POETRY_VERSION: '1.5.1'
jobs:
generate_json:
name: Generate Json Docs
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- name: setup chrome
uses: browser-actions/setup-chrome@latest
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-${{ env.POETRY_VERSION }}-${{ env.PYTHON_VERSION }}
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Build Json docs
run: |
source .venv/bin/activate
python -m generators.blocks_json
env:
LOGURU_LEVEL: INFO
- name: Commit and push changes
run: |
git fetch --prune --unshallow
git add .
git diff
git config --global user.email "[email protected]"
git config --global user.name "Ranger"
git commit -m "Successfully generated docs 🎉" -a || echo "No changes to commit"
git push