diff --git a/.github/workflows/nightly_check.yml b/.github/workflows/nightly_check.yml index 6a4a87c..7338703 100644 --- a/.github/workflows/nightly_check.yml +++ b/.github/workflows/nightly_check.yml @@ -1,75 +1,75 @@ name: Nightly Release on: schedule: # 03:00 UTC ogni giorno - cron: "0 3 * * *" # opzionale: permette lancio manuale workflow_dispatch: permissions: contents: write jobs: build-and-release: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies run: | pip install -r requirements.txt - name: Run script run: | - python scripts/generate_data.py + python parse_gtfs.py - name: Commit versions.json if: steps.check.outputs.changed == 'true' run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add public_data/versions.json # evita errore se non ci sono modifiche git diff --cached --quiet || git commit -m "Update versions.json" git push - name: Generate release tag id: tag if: steps.check.outputs.changed == 'true' run: | TAG="data-$(date +'%Y%m%d')" echo "tag=$TAG" >> $GITHUB_OUTPUT - name: Create Release uses: softprops/action-gh-release@v2 if: steps.check.outputs.changed == 'true' with: tag_name: ${{ steps.tag.outputs.tag }} name: Daily Release ${{ steps.tag.outputs.tag }} files: | public_data/versions.json public_data/*.txt.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Cleanup old releases if: steps.check.outputs.changed == 'true' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release list --limit 100 --json tagName \ | jq -r '.[10:] | .[].tagName' \ | xargs -I {} sh -c 'gh release delete {} --yes --cleanup-tag' \ No newline at end of file