Skip to content

feat: add workflow_dispatch trigger to GitHub Actions and export bibt… #2

feat: add workflow_dispatch trigger to GitHub Actions and export bibt…

feat: add workflow_dispatch trigger to GitHub Actions and export bibt… #2

name: figshare-cache
on:
workflow_dispatch:
schedule:
- cron: "30 2 * * 2"
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 --force-refresh
- name: Nexus Repo Publish
if: ${{ github.event_name != 'pull_request' }}
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://lcas.lincoln.ac.uk/repository/
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}
format: raw
repository: misc
coordinates: directory=bibtex
assets: filename=lcas.bib
filename: ./output/lcas.bib
- name: Upload CSV files as artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: outputs
path: |
./output/*.csv
./output/*.bib
retention-days: 30