Merge pull request #1118 from cmu-delphi/dev #378
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: blog | |
| on: | |
| push: | |
| paths: # run only when an Rmd file changes | |
| - "**.Rmd" | |
| - "environment.yml" | |
| - "dependencies.R" | |
| - ".github/workflows/blog.yaml" | |
| workflow_dispatch: | |
| jobs: | |
| blog: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 3 | |
| - uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| micromamba-version: latest | |
| log-level: debug | |
| cache-environment: true | |
| - name: Install R dependencies | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| Rscript ./dependencies.R | |
| - name: Restore Blogdown Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ./blogdown | |
| key: ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-${{ hashFiles('content/blog/**.Rmd') }} | |
| restore-keys: | | |
| ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}- | |
| ${{ runner.os }}-blogdown2- | |
| - name: Build site | |
| env: | |
| API_KEY: ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }} | |
| run: | | |
| npm run build:blog | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: blog | |
| path: | | |
| ./content/blog | |
| ./static/blog |