Skip to content

Commit

Permalink
commit to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
n00rsy committed Aug 29, 2024
1 parent 97f1936 commit a6751d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ jobs:
GMAPS_CACHE_FILEPATH: ${{ secrets.GMAPS_CACHE_FILEPATH }}
GMAPS_API_KEY: ${{ secrets.GMAPS_API_KEY }}
run: python backend/main.py
- name: Commit and push if content changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git checkout pages
git checkout main -- locations.json
git push
2 changes: 2 additions & 0 deletions backend/gmaps_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def format_key(self, name, address):
return re.sub(r'\(.*?\)', '', f"{name} {address}").strip()

def geocode(self, name, address):
if address.startswith("www."):
raise Exception(f"invalid address:{address}")
key = self.format_key(name, address)
if key in self.gmaps_cache:
print("geocode cache hit: ", key)
Expand Down

0 comments on commit a6751d0

Please sign in to comment.