feat: add caching option to retrieve method in Author class for impro… #161
This file contains hidden or 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: update-cache | |
| on: | |
| schedule: | |
| - cron: "30 2 * * 1" | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| update-cache: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| - name: Use Cache in folder ./output | |
| uses: actions/cache@v3 | |
| with: | |
| path: ./output | |
| key: cache-files | |
| - name: Create output directory if it doesn't exist | |
| run: mkdir -p output | |
| - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
| - run: | | |
| git config --global user.name 'L-CAS GitHub' | |
| git config --global user.email 'marc@hanheide.net' | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| set -e | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-frozen.txt | |
| - name: Run figshare exporter | |
| run: | | |
| set -e | |
| cd ./output | |
| python ../figshare.py | |
| - name: Run ORCID exporter | |
| run: | | |
| set -e | |
| python lcas-bib-export-generator.py | |
| - if: github.event_name != 'pull_request' | |
| run: | | |
| git add -f *.bib *.json *.html | |
| git commit -m "automated commit `date`" | |
| git push | |
| - name: Upload CSV files as artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: csv-files | |
| path: ./output/*.csv | |
| retention-days: 30 |