Skip to content

Commit

Permalink
Update GitHub action for building website.
Browse files Browse the repository at this point in the history
  • Loading branch information
frfeng committed Nov 14, 2023
1 parent 148057f commit 08ceb63
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,61 +31,61 @@ jobs:
run: |
gem install github-pages bundler kramdown kramdown-parser-gfm
- name: Install Python modules
run: |
python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
# - name: Install Python modules
# run: |
# python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests

- name: Checkout the lesson
uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Look for R-markdown files
id: check-rmd
run: |
echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"
# - name: Look for R-markdown files
# id: check-rmd
# run: |
# echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"

# - name: Set up R
# if: steps.check-rmd.outputs.count != 0
# uses: r-lib/actions/setup-r@master
# with:
# r-version: 'release'

- name: Restore R Cache
if: steps.check-rmd.outputs.count != 0
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
# - name: Restore R Cache
# if: steps.check-rmd.outputs.count != 0
# uses: actions/cache@v2
# with:
# path: ${{ env.R_LIBS_USER }}
# key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
# restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install needed packages
if: steps.check-rmd.outputs.count != 0
run: |
source('bin/dependencies.R')
install_required_packages()
shell: Rscript {0}
# - name: Install needed packages
# if: steps.check-rmd.outputs.count != 0
# run: |
# source('bin/dependencies.R')
# install_required_packages()
# shell: Rscript {0}

- name: Query dependencies
if: steps.check-rmd.outputs.count != 0
run: |
source('bin/dependencies.R')
deps <- identify_dependencies()
create_description(deps)
use_bioc_repos()
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
# - name: Query dependencies
# if: steps.check-rmd.outputs.count != 0
# run: |
# source('bin/dependencies.R')
# deps <- identify_dependencies()
# create_description(deps)
# use_bioc_repos()
# saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
# writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
# shell: Rscript {0}


- name: Install system dependencies for R packages
if: steps.check-rmd.outputs.count != 0
run: |
while read -r cmd
do
eval sudo $cmd || echo "Nothing to update"
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
# - name: Install system dependencies for R packages
# if: steps.check-rmd.outputs.count != 0
# run: |
# while read -r cmd
# do
# eval sudo $cmd || echo "Nothing to update"
# done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')

- name: Render the markdown and confirm that the site can be built
run: make site
Expand Down

0 comments on commit 08ceb63

Please sign in to comment.