adding new mongo update action #1
Workflow file for this run
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
name: mongo-update | |
on: | |
push: | |
branches: [ mongo ] | |
pull_request: | |
branches: [ mongo ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- {os: windows-latest, r: 'release'} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
needs: check | |
- name: Clone allometric/allometric. | |
run: | | |
git clone --single-branch --branch mongo https://github.com/allometric/allometric.git | |
- name: Install allometric, update mongodb. | |
env: | |
MONGODB_URL: ${{secrets.MONGODB_URL}} | |
run: | | |
url <- Sys.getenv("MONGODB_URL") | |
devtools::install("./allometric", reload = FALSE); | |
library(allometric) | |
library(mongolite) | |
model_con <- mongo("models", url = url) | |
map_publications(TRUE, replace_pub_models, model_con, pub_path = "./publications", params_path = "./parameters") | |
warnings(); | |
shell: Rscript {0} | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: mongo | |
commit_message: Updating models.RDS | |
file_pattern: '*.RDS' |