build-site #290
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
# Run the action on pushes to the master branch, manually, or on pull requests | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
workflow_dispatch: | |
branches: | |
- '*' | |
schedule: | |
- cron: "0 0 * * *" | |
name: build-site | |
jobs: | |
build-site: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
steps: | |
- name: Fetch the repository | |
uses: actions/checkout@v2 | |
- name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
- name: 💎 Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
- name: Install R packages from renv.lock (with cache) | |
if: ${{ !env.ACT }} ## Doesn't work locally with ACT | |
uses: r-lib/actions/setup-renv@v2 | |
with: | |
cache-version: 2 | |
- name: Install R packages from renv.lock (local, no cache) | |
if: ${{ env.ACT }} ## Only locally with ACT, use `act -r` to reuse containers, effectively caching locally | |
run: | | |
renv::restore() | |
shell: Rscript {0} | |
- name: Get membership data | |
run: | | |
Rscript R/update_people.R | |
- name: install jekyll dependencies & build site | |
uses: limjh16/jekyll-action-ts@v2 | |
with: | |
enable_cache: ${{ !env.ACT }} | |
- name: 🚀 deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ !env.ACT && github.ref == 'refs/heads/master'}} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site | |
publish_branch: gh-pages | |
cname: www.repidemicsconsortium.org | |
- name: On failure, launch a temporary interactive debugging session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ failure() }} | |
timeout-minutes: 15 | |
with: | |
limit-access-to-actor: true |