Skip to content

Update imagineRio

Update imagineRio #43

Workflow file for this run

name: Update imagineRio
on:
repository_dispatch:
types: [submodule-update]
workflow_dispatch:
inputs:
retile:
description: "Retile images"
type: boolean
required: false
default: false
jobs:
update-process:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Update submodule to latest commit
run: |
cd data
git checkout main
git pull origin main
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Fetch 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: 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 }}
RETILE: ${{ github.event.inputs.retile }}
run: |
docker run \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_ACCESS_KEY_ID \
-e ARCGIS_USER \
-e ARCGIS_PASSWORD \
-e VIEWCONES_LAYER_URL \
-e RETILE \
-v $(pwd)/data:/usr/src/app/data \
etl
- name: Commit and push changes
run: |
cd data
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Auto updated data" && git push origin HEAD:main || echo "No changes to commit"
cd ..
git config user.name github-actions
git config user.email github-actions@github.com
git add data
git commit -m "Auto updated submodule reference" && git push || echo "No changes to commit"