Skip to content

adjusting action to read url from environment variables #20

adjusting action to read url from environment variables

adjusting action to read url from environment variables #20

name: model-install
on:
push:
branches: [ mongo_upsert ]
pull_request:
branches: mongo_upsert
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 https://github.com/allometric/allometric.git
- name: Update database
env:
MONGODB_URL_DEV: ${{secrets.MONGODB_URL_DEV}}
run: |
devtools::install("./allometric", reload = FALSE);
library(allometric);
devtools::load_all(".");
url <- Sys.getenv("MONGODB_URL_DEV");
model_con <- get_model_con(url);
pub_con <- get_pub_con(url);
update_con <- get_update_con_con(url);
update_db(pub_con, model_con, update_con, last_commit = "abbbc1b")
warnings();
shell: Rscript {0}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Updating models.RDS
file_pattern: '*.RDS'