Skip to content

Commit a027290

Browse files
committed
update actions
1 parent 7cee028 commit a027290

File tree

4 files changed

+68
-30
lines changed

4 files changed

+68
-30
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Quality Control
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'README.md'
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- 'README.md'
12+
workflow_dispatch:
13+
14+
jobs:
15+
readme:
16+
runs-on: ubuntu-22.04
17+
18+
env:
19+
RENV_PATHS_ROOT: ~/.local/share/renv # persistent cache location
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Install pandoc
26+
run: sudo apt-get update && sudo apt-get install -y pandoc
27+
28+
- name: Deploy RMD to gh-pages
29+
if: success()
30+
run: |
31+
git config --global user.name "github-actions[bot]"
32+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
33+
OUTPUT_FILE="README.md"
34+
35+
# Create a temporary worktree for gh-pages branch
36+
git fetch origin gh-pages || true
37+
git worktree add /tmp/gh-pages gh-pages || git worktree add /tmp/gh-pages -b gh-pages
38+
39+
# Copy the file to the worktree
40+
cp "$OUTPUT_FILE" /tmp/gh-pages/
41+
42+
cd /tmp/gh-pages
43+
44+
# Commit and push if there are changes
45+
git add README.md
46+
git commit -m "Deploy README.md [skip ci]"
47+
git push --force origin gh-pages
48+
49+
# Clean up
50+
cd -
51+
git worktree remove /tmp/gh-pages
52+
shell: bash

.github/workflows/01_run_scrna_qc.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,18 @@ jobs:
6868
git config --global user.email "github-actions[bot]@users.noreply.github.com"
6969
OUTPUT_FILE="01_quality_assessment/scRNA_QC.html"
7070
71-
# Create a temporary worktree for gh-pages branch
71+
# Fetch gh-pages (if exists) and create worktree
7272
git fetch origin gh-pages || true
73-
git worktree add /tmp/gh-pages gh-pages || git worktree add /tmp/gh-pages -b gh-pages
73+
git worktree add /tmp/gh-pages gh-pages 2>/dev/null || git worktree add /tmp/gh-pages -b gh-pages
7474
75-
# Copy the file to the worktree
76-
mkdir -p /tmp/gh-pages/01_quality_assessment
77-
cp "$OUTPUT_FILE" /tmp/gh-pages/01_quality_assessment/
75+
# Copy the file into the worktree
76+
mkdir -p "/tmp/gh-pages/$(dirname "$OUTPUT_FILE")"
77+
cp "$OUTPUT_FILE" "/tmp/gh-pages/$(dirname "$OUTPUT_FILE")/"
7878
7979
cd /tmp/gh-pages
8080
8181
# Commit and push if there are changes
82-
if git diff --quiet && git diff --cached --quiet; then
83-
echo "No changes to commit"
84-
else
85-
git add 01_quality_assessment/scRNA_QC.html
86-
git commit -m "Deploy scRNA_QC.html [skip ci]"
87-
git push origin gh-pages
88-
fi
89-
90-
# Clean up
91-
cd -
92-
git worktree remove /tmp/gh-pages
82+
git add "$(dirname "$OUTPUT_FILE")/$(basename "$OUTPUT_FILE")"
83+
git commit -m "Deploy $(basename "$OUTPUT_FILE") [skip ci]"
84+
git push --force origin gh-pages
9385
shell: bash

.github/workflows/02_run_norm_integration.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,18 @@ jobs:
6969
7070
OUTPUT_FILE="02_integration/norm_integration.html"
7171
72-
# Create a temporary worktree for gh-pages branch
72+
# Fetch gh-pages (if exists) and create worktree
7373
git fetch origin gh-pages || true
74-
git worktree add /tmp/gh-pages gh-pages || git worktree add /tmp/gh-pages -b gh-pages
74+
git worktree add /tmp/gh-pages gh-pages 2>/dev/null || git worktree add /tmp/gh-pages -b gh-pages
7575
76-
# Copy the file to the worktree
77-
mkdir -p /tmp/gh-pages/02_integration
78-
cp "$OUTPUT_FILE" /tmp/gh-pages/02_integration/
76+
# Copy the file into the worktree
77+
mkdir -p "/tmp/gh-pages/$(dirname "$OUTPUT_FILE")"
78+
cp "$OUTPUT_FILE" "/tmp/gh-pages/$(dirname "$OUTPUT_FILE")/"
7979
8080
cd /tmp/gh-pages
81-
ls -R .
8281
83-
git add 02_integration/norm_integration.html
84-
git commit -m "Deploy norm_integration.html [skip ci]"
82+
# Commit and push if there are changes
83+
git add "$(dirname "$OUTPUT_FILE")/$(basename "$OUTPUT_FILE")"
84+
git commit -m "Deploy $(basename "$OUTPUT_FILE") [skip ci]"
8585
git push --force origin gh-pages
86-
87-
# Clean up
88-
cd -
89-
git worktree remove /tmp/gh-pages
9086
shell: bash

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ Read full documentation at [03_differential_expression/README.md](03_differentia
4545

4646
- ![](https://img.shields.io/badge/status-stable-green) [MAST scRNA](03_differential_expression/scRNA_MAST.Rmd) is a template to visualize differentially expressed genes (DEG) results generated from MAST analysis. 👀 [See an example](https://bcbio.github.io/singlecell-reports/03_differential_expression/scRNA_MAST.html)
4747

48-
## Compositional Analysis
49-
5048
# Compositional Analysis
5149

5250
![](https://img.shields.io/badge/status-draft-grey) [`04_compositional/propeller.Rmd`](04_compositional/propeller.Rmd) and [`04_compositional/sscomp.Rmd`](04_compositional/sccomp.Rmd) are templates to run compositional analysis with two different methods. `comp.png` is an example of `sccomp.Rmd` analysis.

0 commit comments

Comments
 (0)