Update database collections #39
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: Update database collections | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 15 * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
download-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: main | |
- name: Fetch GMT files | |
id: gmts | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev | |
shiny_run/scripts/fetch_gmts.sh | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install packages | |
run: | | |
install.packages(c("dplyr","magrittr","httr","jsonlite","BiocManager")) | |
BiocManager::install("rWikiPathways", ask = FALSE) | |
shell: Rscript {0} | |
- name: Build database | |
run: | | |
Rscript -e "source('shiny_run/scripts/build_db_ghaction.R')" | |
- name: Rotate and commit | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email '[email protected]' | |
if [ "$(ls -A shiny_run/databases/temp)" ]; then | |
git rm -f shiny_run/databases/archive/*.RData | |
mkdir shiny_run/databases/archive | |
git mv -f shiny_run/databases/*.RData shiny_run/databases/archive/ | |
mv shiny_run/databases/temp/*.RData shiny_run/databases/ | |
git add -f shiny_run/databases/*.RData | |
git commit -m 'Update RData database collections' | |
git push | |
else | |
echo "No new RData files" | |
fi |