diff --git a/.env.example b/.env.example index f696ab0..8f94f99 100644 --- a/.env.example +++ b/.env.example @@ -5,3 +5,6 @@ BLUESKY_HANDLE= BLUESKY_PASSWORD= APP_ENV= +CITY_NAME=Boston +CITY_STATE=MA +POSTAL_CODE=02108 \ No newline at end of file diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 35f02c5..9e60912 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -65,6 +65,9 @@ jobs: BLUESKY_PASSWORD: ${{ secrets.BLUESKY_TEST_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} APP_ENV: dev + CITY_NAME: ${{ vars.CITY_NAME }} + CITY_STATE: ${{ vars.CITY_STATE }} + POSTAL_CODE: ${{ vars.POSTAL_CODE }} run: | #In order to create posts on the test accounts remove the --debugposters debug flag python ./main.py --debugsources --debugposters diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index b4f0cd8..515d3e4 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -64,6 +64,9 @@ jobs: MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} APP_ENV: prod + CITY_NAME: ${{ vars.CITY_NAME }} + CITY_STATE: ${{ vars.CITY_STATE }} + POSTAL_CODE: ${{ vars.POSTAL_CODE }} run: python ./main.py - name: Upload database artifact diff --git a/config.py b/config.py index d7ee669..90f731c 100644 --- a/config.py +++ b/config.py @@ -1,7 +1,10 @@ -CITY_NAME = "Boston" -CITY_STATE = "MA" -CITY_HASHTAGS = ["Boston"] -POSTAL_CODE = "02108" +import os + +# Import environment variables and fallback to defaults for Boston if not found. +CITY_NAME = os.environ.get("CITY_NAME", "Boston") +CITY_STATE = os.environ.get("CITY_STATE", "MA") +CITY_HASHTAGS = [CITY_NAME] +POSTAL_CODE = os.environ.get("POSTAL_CODE", "02108") # RescueGroups API plural species names for the species we post about. PET_SPECIES = ("dogs", "cats")