Publish HTML #62
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
name: Publish HTML | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 9 * * *' # This will run at 09:00 UTC every day (5:00 AM ET or 4:00 AM EST) | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Download latest card data | |
run: python card_aggregator.py download | |
- name: Update creature and land types | |
run: python card_aggregator.py update-types | |
- name: Run card aggregator | |
run: python card_aggregator.py run | |
- name: Flatten output directory | |
run: | | |
mkdir -p ./flattened_output | |
find ./data/output -type f -exec cp {} ./flattened_output \; | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.FINE_GRAINED_PAT }} | |
publish_dir: ./flattened_output | |
keep_files: false | |
- name: Archive card data | |
uses: actions/upload-artifact@v2 | |
with: | |
name: card-data | |
path: ./data/*.json | |
retention-days: 7 |