Merge pull request #1 from smach/publish-reusable-data #10
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: Render and publish | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| # Hourly during match windows (15:00–06:00 UTC), skip overnight lull. | |
| - cron: "0 0-6,15-23 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| render: | |
| runs-on: ubuntu-latest | |
| env: | |
| FOOTBALL_DATA_API_KEY: ${{ secrets.FOOTBALL_DATA_API_KEY }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Setup Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Install package dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| # Only hard deps (Imports) plus what Quarto needs to render index.qmd. | |
| # The default ("all") also installs Suggests (shiny, ellmer, querychat, | |
| # bslib, testthat, ...), which the static site never uses. Caching is on | |
| # by default; trimming the set speeds up both cold installs and restores. | |
| dependencies: '"hard"' | |
| extra-packages: | | |
| any::rmarkdown | |
| any::knitr | |
| any::jsonlite | |
| local::. | |
| - name: Render site | |
| run: quarto render | |
| - name: Build downloadable data files | |
| run: Rscript data-raw/publish_data.R | |
| - name: Publish to gh-pages | |
| uses: quarto-dev/quarto-actions/publish@v2 | |
| with: | |
| target: gh-pages | |
| render: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |