-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 1.72 KB
/
cron_update_SPI24.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 * * 2" # Runs every Tuesday at 12:00 UTC
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 }}
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"
python automation/month_24_automation.py