-
Notifications
You must be signed in to change notification settings - Fork 18
60 lines (51 loc) · 1.61 KB
/
on_stats_change.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
57
58
59
60
name: When stats change, knit stats.Rmd
## stat data files = _data/edit_counts.csv and _data/pathway_counts.csv
on:
workflow_dispatch:
push:
branches:
- main
paths:
- _data/*_counts.csv
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
update-stats:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libmagick++-dev
Rscript -e 'install.packages(c("knitr","scales","plyr","dplyr","magrittr","magick","remotes","stringr","ggplot2"))'
- name: Install BiocManager
run: |
remotes::install_cran("BiocManager")
shell: Rscript {0}
- name: BiocManager installations
run: |
BiocManager::install("RColorBrewer", ask = FALSE)
BiocManager::install("rWikiPathways", ask = FALSE)
shell: Rscript {0}
- name: Knit stats.Rmd
run: Rscript -e 'knitr::knit("_rmd/stats.Rmd", "stats.md")'
- name: Commit report
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add .
if git diff --exit-code --staged; then
echo "No changes"
else
git pull
git commit -m 'Update stats .md and files'
git push
fi