Generate arXiv HTML #3104
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 arXiv HTML | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' | |
| - cron: '30 15-23 * * 1-5' | |
| workflow_dispatch: # Allow manual triggering | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| generate-html: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Restore cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: _data | |
| key: data-cache- | |
| - name: Create directories | |
| run: mkdir -p _pages _data | |
| - name: Download input CSV | |
| run: curl -L -o _data/input.new.csv "${{ secrets.INPUT_CSV_URL }}" | |
| - name: Check if input CSV has changed | |
| id: check_input | |
| if: ${{ hashFiles('_data/input.new.csv') != hashFiles('_data/input.csv') }} | |
| run: mv _data/input.new.csv _data/input.csv | |
| - name: Set up Python | |
| if: steps.check_input.outcome == 'success' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Generate HTML | |
| if: steps.check_input.outcome == 'success' | |
| run: python run.py _data/input.csv template.html _pages/index.html --cache=_data/meta.json | |
| - name: Save cache | |
| if: steps.check_input.outcome == 'success' | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: _data | |
| key: data-cache-${{ github.run_id }} | |
| - uses: peaceiris/actions-gh-pages@v4 | |
| if: steps.check_input.outcome == 'success' | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: _pages |