submodule-update #6
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: Update imagineRio | |
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: | |
build-and-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Update submodule | |
run: | | |
cd data | |
git pull --ff-only origin main | |
- name: Build Docker image | |
run: docker build . -t etl | |
- name: Run Docker Image | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
ARCGIS_USER: ${{ secrets.ARCGIS_USER }} | |
ARCGIS_PASSWORD: ${{ secrets.ARCGIS_PASSWORD }} | |
VIEWCONES_LAYER_URL: ${{ secrets.VIEWCONES_LAYER_URL }} | |
run: | | |
ARGS="" | |
if [ ! -z "${{ github.event.inputs.index }}" ]; then | |
ARGS="-m imaginerio-etl.scripts.iiif -i ${{ github.event.inputs.index }}" | |
fi | |
if [ "${{ github.event.inputs.retile }}" == "true" ]; then | |
ARGS="$ARGS --retile" | |
fi | |
docker run \ | |
-e AWS_SECRET_ACCESS_KEY | |
-e AWS_ACCESS_KEY_ID | |
-e ARCGIS_USER | |
-e ARCGIS_PASSWORD | |
-e VIEWCONES_LAYER_URL | |
etl $ARGS | |
- name: Commit submodule changes and update pointer | |
run: | | |
cd data | |
git config --global user.name 'martimpassos' | |
git config --global user.email '[email protected]' | |
git add . | |
if git diff --staged --quiet; then | |
echo "No changes detected, skipping commit." | |
else | |
git commit -m "Update output KMLs" | |
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 |