Skip to content

Update imagineRio (no docker) #13

Update imagineRio (no docker)

Update imagineRio (no docker) #13

name: Update imagineRio (no docker)
on:
repository_dispatch:
types: [submodule-update]
workflow_dispatch:
inputs:
index:
description: "SSIDs to process (space separated, e.g. '35103808 35103809'), leave blank to process all items"
required: false
default: ""
retile:
description: "Retile images. Should only be used when specifying ids above"
type: boolean
required: false
jobs:
update-process:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
submodules: true
# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: "18"
# - name: Install dependencies
# run: npm install
# - name: Fetch JSTOR data
# run: node imaginerio-etl/utils/fetchData.js
# env:
# JSTOR_USER: ${{ secrets.JSTOR_USER }}
# JSTOR_PASSWORD: ${{ secrets.JSTOR_PASSWORD }}
# JSTOR_PROJECT: ${{ secrets.JSTOR_PROJECT }}
# - name: Compare data
# run: |
# pip install pandas xlrd openpyxl
# python3 imaginerio-etl/utils/compare_data.py
# if [ -f "data/input/items_to_process.xls" ]; then
# echo "::set-output name=file_created::true"
# else
# echo "::set-output name=file_created::false"
# fi
- name: Check for KML files
id: check_kml_files
run: echo "::set-output name=kml_exists::$(find data/input/kmls -type f -name '*.kml' | wc -l | awk '{if($1>0) print "true"; else print "false"}')"
- name: Process viewcones
if: steps.check_kml_files.outputs.kml_exists == 'true'
run: |
sudo apt-get update
sudo apt-get install -y gcc heimdal-dev
pip install arcgis --no-deps
pip install turfpy lxml geojson cachetools requests requests-oauthlib requests-toolbelt geomet ujson mercantile pandas numpy shapely pyproj SPARQLWrapper pillow
python3 -m imaginerio-etl.scripts.viewcones
- name: Create IIIF manifests
if: steps.compare_data.outputs.file_created == 'true'
run: |
sudo apt-get update
sudo apt-get install -y libvips libvips-tools
pip install -r requirements.txt
python3 -m imaginerio-etl.scripts.iiif
- name: Commit and push changes
run: |
cd data
git config --global user.name 'martimpassos'
git config --global user.email 'martimpassos@users.noreply.github.com'
git add .
if git diff --staged --quiet; then
echo "No changes detected, skipping commit."
else
git commit -m "Update data"
git push
fi
cd ..
git add data
if git diff --staged --quiet; then
echo "No changes detected, skipping commit."
exit 0
else
git commit -m "Update submodule"
git push
fi