Skip to content

add visium clustering #1

add visium clustering

add visium clustering #1

name: Visium Clustering and Annotation
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
r-visium-clustering:
runs-on: ubuntu-22.04
env:
RENV_PATHS_ROOT: ~/.local/share/renv # persistent cache location
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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
shell: bash
- name: Cache R packages (renv)
uses: actions/cache@v4
with:
path: |
~/.local/share/renv
renv/library
key: ${{ runner.os }}-renv-${{ hashFiles('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)
shell: Rscript {0}
- name: Get data
run: Rscript visium/download-test-data.R
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Run clustering and annotation
id: render_qmd
run: |
if git diff --quiet origin/main -- visium/02_clustering_annotation/02_clustering_annotation.qmd; then
echo "No changes in 02_clustering_annotation.qmd. Skipping render."
exit 0
else
quarto render visium/02_clustering_annotation/02_clustering_annotation.qmd
fi
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"
git fetch origin gh-pages || git checkout --orphan gh-pages
git switch gh-pages || git checkout -b gh-pages
# mkdir -p visium/02_clustering_annotation
# cp visium/02_clustering_annotation/02_clustering_annotation.html visium/02_clustering_annotation/
git add visium/02_clustering_annotation/02_clustering_annotation.html
git commit -m "Deploy 02_clustering_annotation.html [skip ci]" || echo "No changes to commit"
git push origin gh-pages
shell: bash