Push stats back to main branch #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docs from cached data | |
on: | |
pull_request: | |
schedule: | |
- cron: '0 5 * * *' # once per day at midnight ET | |
workflow_dispatch: | |
jobs: | |
build-analytics-data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel non-latest runs | |
uses: styfle/[email protected] | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 # tags are required for versioneer to determine the version | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Sphinx dependencies and package | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt -r requirements-doc.txt | |
python -m pip install . | |
git clone https://github.com/hdmf-dev/hdmf-docutils.git | |
cd hdmf-docutils | |
pip install -e . | |
cd .. | |
sudo apt install cloc | |
- name: build the docs | |
run: | | |
rm data/cloc_stats.yaml | |
rm data/commit_stats.yaml | |
rm data/git_paths.yaml | |
rm data/release_timelines.yaml | |
cd docs | |
make allclean | |
make html | |
- name: push updated yaml to the repo | |
git --version | |
git config --global user.email "[email protected]" | |
git config --global user.name "NWB Bot" | |
git config --global init.defaultBranch main | |
git remote set-url origin https://x-access-token:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/@{{ github.repository }} | |
git commit -m "Automatic update of the code statistics YAML files" data/*.yaml | |
git push |