-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (68 loc) · 2.69 KB
/
03_run_scrna_pseudobulk.yml
File metadata and controls
86 lines (68 loc) · 2.69 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: scRNA Pseudobulk Analysis
on:
push:
branches: [main]
paths:
- '03_differential_expression/scRNA_pseudobulk.qmd'
pull_request:
branches: [main]
paths:
- '03_differential_expression/scRNA_pseudobulk.qmd'
workflow_dispatch:
jobs:
r-pseudobulk:
runs-on: ubuntu-22.04
env:
RENV_PATHS_ROOT: ~/.local/share/renv # persistent cache location
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Install system dependencies for R packages
run: |
sudo apt-get update
sudo apt-get install -y build-essential libcurl4-openssl-dev libssl-dev libxml2-dev libgit2-dev libmagick++-dev libharfbuzz-dev libfribidi-dev libglpk-dev
shell: bash
- name: Cache R packages (renv)
uses: actions/cache@v4
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('03_differential_expression/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Set repositories
run: Rscript ubuntu.R
- name: Restore environment from renv.lock
run: |
install.packages("renv", repos = "https://cloud.r-project.org")
renv::restore(prompt = FALSE, lockfile = "03_differential_expression/renv.lock")
shell: Rscript {0}
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Run pseudobulk analysis
id: render_qmd
run: |
cd 03_differential_expression
quarto render scRNA_pseudobulk.qmd
shell: bash
- name: Deploy HTML to gh-pages
if: success()
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
OUTPUT_FILE="03_differential_expression/scRNA_pseudobulk.html"
# Fetch gh-pages (if exists) and create worktree
git fetch origin gh-pages || true
git worktree add /tmp/gh-pages gh-pages 2>/dev/null || git worktree add /tmp/gh-pages -b gh-pages
# Copy the file into the worktree
mkdir -p "/tmp/gh-pages/$(dirname "$OUTPUT_FILE")"
cp "$OUTPUT_FILE" "/tmp/gh-pages/$(dirname "$OUTPUT_FILE")/"
cd /tmp/gh-pages
# Commit and push if there are changes
git add "$(dirname "$OUTPUT_FILE")/$(basename "$OUTPUT_FILE")"
git commit -m "Deploy $(basename "$OUTPUT_FILE") [skip ci]"
git push --force origin gh-pages
shell: bash