Skip to content

Updated github actions #68

Updated github actions

Updated github actions #68

Workflow file for this run

name: WHOTS Scrape Metadata
on:
#
push:
workflow_dispatch:
# At 00:00 on day-of-month 1 --> https://crontab.guru/#0_0_*_*_*
schedule:
- cron: "0 0 1 * *"
jobs:
scheduled:
# Set up operating system
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
# Define job steps
steps:
# Check repository
- name: Check-out repository
uses: actions/checkout@v3
# Set up a Python environment for use in actions
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the
# miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file environment.yml --name base
- name: Activate conda
run: |
echo $CONDA/bin/activate base
- name: Fetch latest WHOTS data
working-directory: ./src/whots_metadata
run: |-
scrapy crawl whotsmetadata -O ../../results/items.json
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest WHOTS Metadadata: ${timestamp}" || exit 0
git push