Repository navigation
Twice-Daily Rebuild Outputs #1385
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: Twice-Daily Rebuild Outputs | |
| on: | |
| schedule: | |
| - cron: 0 */12 * * * | |
| workflow_dispatch: | |
| permissions: write-all | |
| jobs: | |
| build: | |
| if: github.repository == 'mtgjson/mtg-sealed-content' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout repo content | |
| uses: actions/checkout@v5 | |
| with: | |
| lfs: true | |
| - name: setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: install python packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: execute import of new deck | |
| run: python scripts/import_new_decks.py | |
| - name: execute new products | |
| env: | |
| TCG_AUTH: ${{ secrets.TCG_AUTH }} | |
| run: python scripts/load_new_products.py $TCG_AUTH | |
| - name: associate names | |
| run: python scripts/check_product_fuzzy.py --auto --auto-margin 3 | |
| - name: execute contents compiler | |
| run: python scripts/product_contents_compiler.py | |
| - name: execute manual products compiler | |
| run: python scripts/new_products_compiler.py | |
| - name: execute card to product mapper | |
| run: python scripts/card_to_product_compiler.py -o outputs/card_map.json | |
| - name: execute token products mapping compiler | |
| run: python -m scripts.tokens.main | |
| env: | |
| TCGPLAYER_CLIENT_ID: ${{ secrets.TCGPLAYER_CLIENT_ID }} | |
| TCGPLAYER_CLIENT_SECRET: ${{ secrets.TCGPLAYER_CLIENT_SECRET }} | |
| - name: validate card_map is not empty | |
| run: | | |
| if [ ! -s outputs/card_map.json ]; then | |
| echo "ERROR: card_map.json is empty or missing" | |
| exit 1 | |
| fi | |
| KEYS=$(python -c "import json; print(len(json.load(open('outputs/card_map.json'))))") | |
| if [ "$KEYS" -eq 0 ]; then | |
| echo "ERROR: card_map.json has no entries" | |
| exit 1 | |
| fi | |
| echo "card_map.json has $KEYS entries" | |
| - name: commit and push changes | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| file_pattern: 'data/ outputs/ status.txt' | |
| commit_message: Pull new daily content | |
| push_options: --force |