Skip to content

Update 24-month SPI Anomaly (Long-term) #63

Update 24-month SPI Anomaly (Long-term)

Update 24-month SPI Anomaly (Long-term) #63

name: Update 24-month SPI Anomaly (Long-term)
on:
push:
branches:
- earthengine-actions
workflow_dispatch:
# Allows manual triggering of the action
schedule:
- cron: "0 12 * * *" # Runs daily at 12:00 UTC, adjust as needed
jobs:
spi-24-month:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Upgrade pip & Install dependencies
run: |
pip3 install --upgrade pip==22.0
echo "Installing Python dependencies"
if [ -f ./python/requirements.txt ]; then pip install -r ./python/requirements.txt; fi
pip install rasterio
pip install earthengine-api
pip install earthengine-api --upgrade
- uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"
# Get file source name and put it on env
- name: Run Python Script on File
run: |
python python/getFilename24month.py
- name: Copy from Google storage to local
run: |
gcloud storage cp $WPS_24_MONTH_GS $WPS_24_MONTH_FILENAME.tif
# Get file source name and put it on env
- name: Project downloaded file
run: |
python python/project24month.py