File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,26 +3,34 @@ name: L.A. Districts Shapefile Workflow
33on :
44 workflow_dispatch :
55 schedule :
6- - cron : " 15 4 1 * *" # Monthly at 04:15 UTC to avoid high load
6+ - cron : " 15 4 1 * *" # Monthly at 04:15 UTC
7+
8+ permissions :
9+ contents : read
710
811jobs :
912 download_shapefiles :
1013 runs-on : ubuntu-latest
1114 steps :
12- - uses : actions/checkout@v2
15+ - name : Checkout repo
16+ uses : actions/checkout@v4
17+
1318 - name : Set up Python
14- uses : actions/setup-python@v2
19+ uses : actions/setup-python@v5
1520 with :
16- python-version : ' 3.10.6'
21+ python-version : " 3.10"
22+ cache : " pip"
23+
1724 - name : Install dependencies
1825 run : |
1926 python -m pip install --upgrade pip
20- pip install -r requirements.txt
21- - name : Decode JSON configuration for token.json
27+ pip install -r requirements.txt
28+
29+ - name : Decode service account JSON
2230 run : echo "${{ secrets.ENCODED_JSON }}" | base64 --decode > ./drive_utils/token.json
23- env :
24- ENCODED_JSON : ${{ secrets.ENCODED_JSON }}
31+
2532 - name : Run main.py
2633 run : python main.py
2734 env :
28- FOLDER_ID : ${{ secrets.FOLDER_ID }}
35+ DRIVE_FOLDER_ID : ${{ vars.DRIVE_FOLDER_ID }}
36+ DRIVE_LOG_FOLDER_ID : ${{ vars.DRIVE_LOG_FOLDER_ID }}
Original file line number Diff line number Diff line change 2222OUTPUT_DIR = "shapefiles_output"
2323os .makedirs (OUTPUT_DIR , exist_ok = True )
2424
25- # Google Drive Shared Folder ID
26- DRIVE_FOLDER_ID = "1vn4Jn41pyD6FlhNPncn3iBFW8gUFxcni"
27- DRIVE_LOG_FOLDER_ID = "1N6_3UC7y58QijWdSaBkF45zT6E1XBmQl"
25+ # Google Drive Shared Folder IDs (from env)
26+ DRIVE_FOLDER_ID = os .getenv ("DRIVE_FOLDER_ID" )
27+ DRIVE_LOG_FOLDER_ID = os .getenv ("DRIVE_LOG_FOLDER_ID" )
28+
29+ if not DRIVE_FOLDER_ID or not DRIVE_LOG_FOLDER_ID :
30+ raise RuntimeError ("Missing required Google Drive folder IDs" )
2831
2932# District API endpoints (ArcGIS REST services)
3033API_URLS = {
You can’t perform that action at this time.
0 commit comments