Run C-Star KML Generation #241
This file contains hidden or 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
| name: Run C-Star KML Generation | |
| "on": | |
| schedule: | |
| # Run every 6 hours (00:00, 06:00, 12:00, 18:00 UTC) | |
| - cron: '0 */6 * * *' | |
| # Allow manual triggering for testing | |
| workflow_dispatch: | |
| jobs: | |
| generate-cstar-kml: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Allow pushing changes to repository | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 # Fetch full history for proper git operations | |
| - 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 -r requirements.txt | |
| # Install optional dependencies for enhanced functionality | |
| pip install matplotlib shapely | |
| - name: Create output directory | |
| run: mkdir -p Cstar_Locations | |
| - name: Run C-Star KML script | |
| continue-on-error: true | |
| run: | | |
| python scripts/cstar_kml.py --nhc-cone-url="" < /dev/null | |
| - name: Configure Git | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| - name: Commit and push updated files | |
| run: | | |
| # Check if there are any changes to commit | |
| git add Cstar_Locations/ | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| echo "Committing updated files:" | |
| git status --porcelain | |
| git commit -m "Update C-Star KMZ files - $(date -u +"%Y-%m-%d %H:%M:%S UTC")" | |
| git push | |
| fi | |
| - name: Upload generated KMZ file | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cstar-locations-kmz | |
| path: Cstar_Locations/cstar_locations.kmz | |
| retention-days: 7 | |
| - name: List generated files | |
| if: always() | |
| run: | | |
| echo "Generated files:" | |
| ls -la Cstar_Locations/ |