Skip to content

Generate Blocks Json #1056

Generate Blocks Json

Generate Blocks Json #1056

Workflow file for this run

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