qc yaml #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Quality Control | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - '01_quality_assessment/scRNA_QC.qmd' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '01_quality_assessment/scRNA_QC.qmd' | |
| workflow_dispatch: | |
| jobs: | |
| r-qc: | |
| 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('01_quality_assessment/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 = "01_quality_assessment/renv.lock") | |
| shell: Rscript {0} | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Run quality assessment | |
| id: render_qmd | |
| run: | | |
| cd 01_quality_assessment | |
| quarto render scRNA_QC.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" | |
| # Fetch gh-pages branch (create if missing) | |
| OUTPUT_FILE="01_quality_assessment/scRNA_QC.html" | |
| git fetch origin gh-pages || true | |
| if git show-ref --verify --quiet refs/remotes/origin/gh-pages; then | |
| git checkout gh-pages | |
| git merge --strategy=ours origin/gh-pages | |
| else | |
| git checkout --orphan gh-pages | |
| fi | |
| # Copy the HTML file into place (keep existing files) | |
| mkdir -p 01_quality_assessment | |
| cp "$OUTPUT_FILE" 01_quality_assessment/ | |
| # Commit only if changes exist | |
| git add 01_quality_assessment/scRNA_QC.html | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "Deploy scRNA_QC.html [skip ci]" | |
| git push origin gh-pages | |
| fi | |
| shell: bash |