Skip to content

Commit

Permalink
Merge pull request #61 from reconhub/automate-membership
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Ross authored Mar 4, 2022
2 parents 9401b97 + 7bc6eb4 commit af9f6f2
Show file tree
Hide file tree
Showing 198 changed files with 2,745 additions and 1,010 deletions.
27 changes: 27 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if (file.exists(".env")) {
try(readRenviron(".env"), silent = TRUE)
}

# Use RSPM to install packages if possible
if (Sys.info()[['sysname']] %in% c('Linux', 'Windows')) {
options(repos = c(RSPM = "https://packagemanager.rstudio.com/all/latest"))
} else {
## For Mac users, we'll default to installing from CRAN/MRAN instead, since
## RSPM does not yet support Mac binaries.
options(repos = c(CRAN = "https://cran.rstudio.com/"),
pkgType = "both")
# options(renv.config.mran.enabled = TRUE) ## TRUE by default
}


# Configure Renv
options(
renv.config.repos.override = getOption("repos"),
renv.config.auto.snapshot = FALSE, ## Don't keep renv.lock updated automatically (messes up GitHub Actions)
renv.config.rspm.enabled = TRUE, ## Use RStudio Package manager for pre-built package binaries
renv.config.install.shortcuts = TRUE, ## Use the existing local library to fetch copies of packages for renv
renv.config.cache.enabled = TRUE ## Use the renv build cache to speed up install times
)

# Activate the project on starting
source("renv/activate.R")
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
68 changes: 68 additions & 0 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ R/.RData
*.out
*.toc
.Rproj.user
.env
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Gemfile

source 'https://rubygems.org'

gem 'jekyll', '~> 4.2'

group :jekyll_plugins do
gem 'jekyll-timeago', '~> 0.13.1'
gem 'jekyll-paginate', '~> 1.1.0'
end
74 changes: 74 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
http_parser.rb (0.8.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
jekyll (4.2.1)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-timeago (0.13.1)
mini_i18n (>= 0.8.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
mini_i18n (0.8.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.28.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)

PLATFORMS
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
jekyll (~> 4.2)
jekyll-paginate (~> 1.1.0)
jekyll-timeago (~> 0.13.1)

BUNDLED WITH
2.3.8
13 changes: 0 additions & 13 deletions R/R.Rproj

This file was deleted.

Loading

0 comments on commit af9f6f2

Please sign in to comment.