Generate Pizza Data #237
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: Generate Pizza Data | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Install uv | |
| run: python -m pip install --no-cache-dir uv | |
| - name: Install dependencies | |
| run: uv pip install -r requirements.txt --system | |
| - name: Generate pizza data | |
| run: | | |
| cd scripts | |
| python create_pizza_data.py | |
| mv raw_pizza_sales.csv ../seeds/raw_pizza_sales.csv | |
| mv ingredients.csv ../seeds/ingredients.csv | |
| - name: Commit seed data | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add seeds/raw_pizza_sales.csv seeds/ingredients.csv | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "Update pizza seed data" | |
| git push | |
| fi |