Update 24-month SPI Anomaly Mask (Long-term) #1
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 3-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" | |
env: | |
RW_API_KEY: ${{ secrets.RW_API_KEY }} | |
BUCKET: ${{ vars.BUCKET }} | |
IMAGES_PREFIX_PATH: ${{ vars.IMAGES_PREFIX_PATH }} | |
GS_STAGING_PREFIX: ${{ vars.GS_STAGING_PREFIX }} | |
GEE_PROJECT_FOLDER: ${{ vars.GEE_PROJECT_FOLDER }} | |
MONTH_3_LAYER_ID: ${{ vars.MONTH_3_LAYER_ID }} | |
MONTH_24_LAYER_ID: ${{ vars.MONTH_24_LAYER_ID }} | |
CARTO_MASK_TABLE_NAME: ${{ vars.CARTO_MASK_TABLE_NAME }} | |
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 ./automation/requirements.txt ]; then pip install -r ./automation/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: | | |
echo "ENVS TO USE" | |
echo "BUCKET" | |
echo "IMAGES_PREFIX_PATH" | |
echo "GS_STAGING_PREFIX" | |
echo "GEE_PROJECT_FOLDER" | |
echo "RW_API_KEY" | |
echo "MONTH_24_LAYER_ID" | |
echo "CARTO_MASK_TABLE_NAME" | |
python automation/mask_automation.py | |