feat: add workflow badges, test functions #14
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: mkdocs-deploy | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 6 * * 1' # Runs every Monday at 6 AM | |
workflow_dispatch: # Manually trigger the workflow | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install the requirements | |
shell: bash -l {0} | |
run: | | |
pip3 install mkdocs mkdocs-material mkdocs-material-extensions mkdocstrings mkdocstrings-python | |
pip3 install -r requirements.txt | |
- name: Run literature_fetch | |
shell: bash -l {0} | |
run: | | |
cd app/code | |
python3 literature_fetch.py | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- run: pip install mkdocs-material | |
- run: mkdocs gh-deploy --force | |
# commit | |
- name: Commit files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "update data" -a | |
# push | |
- name: Push changes | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |