|
| 1 | +name: Normalization and Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - '02_integration/norm_integration.qmd' |
| 8 | + pull_request: |
| 9 | + branches: [main] |
| 10 | + paths: |
| 11 | + - '02_integration/norm_integration.qmd' |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + r-integration: |
| 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: Set up R |
| 29 | + uses: r-lib/actions/setup-r@v2 |
| 30 | + |
| 31 | + - name: Install system dependencies for R packages |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y build-essential libcurl4-openssl-dev libssl-dev libxml2-dev libgit2-dev libmagick++-dev libharfbuzz-dev libfribidi-dev libglpk-dev |
| 35 | + shell: bash |
| 36 | + |
| 37 | + - name: Cache R packages (renv) |
| 38 | + uses: actions/cache@v4 |
| 39 | + with: |
| 40 | + path: ${{ env.RENV_PATHS_ROOT }} |
| 41 | + key: ${{ runner.os }}-renv-${{ hashFiles('02_integration/renv.lock') }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-renv- |
| 44 | +
|
| 45 | + - name: Set repositories |
| 46 | + run: Rscript ubuntu.R |
| 47 | + |
| 48 | + - name: Restore environment from renv.lock |
| 49 | + run: | |
| 50 | + install.packages("renv", repos = "https://cloud.r-project.org") |
| 51 | + renv::restore(prompt = FALSE, lockfile = "02_integration/renv.lock") |
| 52 | + shell: Rscript {0} |
| 53 | + |
| 54 | + - name: Set up Quarto |
| 55 | + uses: quarto-dev/quarto-actions/setup@v2 |
| 56 | + |
| 57 | + - name: Run normalization and integration |
| 58 | + id: render_qmd |
| 59 | + run: | |
| 60 | + cd 02_integration |
| 61 | + quarto render norm_integration.qmd |
| 62 | + shell: bash |
| 63 | + |
| 64 | + - name: Deploy HTML to gh-pages |
| 65 | + if: success() |
| 66 | + run: | |
| 67 | + git config --global user.name "github-actions[bot]" |
| 68 | + git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 69 | + git fetch origin gh-pages || git checkout --orphan gh-pages |
| 70 | + git switch gh-pages || git checkout -b gh-pages |
| 71 | + git add 02_integration/norm_integration.html |
| 72 | + git commit -m "Deploy norm_integration.html [skip ci]" || echo "No changes to commit" |
| 73 | + git push origin gh-pages |
| 74 | + shell: bash |
0 commit comments