fix path in action #92
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
# .github/workflows/update-data.yml | |
name: Update Data and Deploy | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Run daily at midnight UTC | |
workflow_dispatch: # Allow manual triggers | |
push: | |
branches: | |
- main | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests==2.31.0 datasette==0.65.1 geojson-to-sqlite==0.1.1 datasette-geojson==0.3 | |
- name: Run update script | |
run: python script.py | |
- name: Commit and push if changed | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email '[email protected]' | |
git add dev-locations/locations.db .python-version | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Update locations $(date -u)" && git push) | |
- name: Deploy to Heroku | |
env: | |
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
run: | | |
# Create static directory and copy CSS file | |
mkdir -p dev-locations/static | |
cp -f static/override.css dev-locations/static/ 2>/dev/null || true | |
# Debug step | |
echo "Static files:" | |
ls -la dev-locations/static/ | |
# Deploy with correct path | |
datasette publish heroku dev-locations/locations.db \ | |
--metadata dev-locations/metadata.json \ | |
--static static:dev-locations/static \ | |
-n tampa-dev-coord-db |