-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (49 loc) · 1.66 KB
/
automatic_rdata_update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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