|
| 1 | +on: [push, pull_request] |
| 2 | + |
| 3 | +env: |
| 4 | + cache-version: v1 |
| 5 | + repo-name: seandavi/buildabiocworkshop |
| 6 | + |
| 7 | +jobs: |
| 8 | + job1: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + container: bioconductor/bioconductor_docker:devel |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v1 |
| 13 | + |
| 14 | + - name: Query dependencies and update old packages |
| 15 | + run: | |
| 16 | + BiocManager::install(ask=FALSE) |
| 17 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
| 18 | + shell: Rscript {0} |
| 19 | + |
| 20 | + - name: Cache R packages |
| 21 | + if: runner.os != 'Windows' |
| 22 | + uses: actions/cache@v1 |
| 23 | + with: |
| 24 | + path: /usr/local/lib/R/site-library |
| 25 | + key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }} |
| 26 | + restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r- |
| 27 | + |
| 28 | + # This lets us augment with additional dependencies |
| 29 | + - name: Install system dependencies |
| 30 | + if: runner.os == 'Linux' |
| 31 | + env: |
| 32 | + RHUB_PLATFORM: linux-x86_64-ubuntu-gcc |
| 33 | + run: | |
| 34 | + Rscript -e "remotes::install_github('r-hub/sysreqs')" |
| 35 | + sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") |
| 36 | + sudo -s eval "$sysreqs" |
| 37 | + |
| 38 | + - name: Install dependencies |
| 39 | + run: | |
| 40 | + options(repos = c(CRAN = "https://cran.r-project.org")) |
| 41 | + BiocManager::repositories() |
| 42 | + remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories()) |
| 43 | + remotes::install_cran("rcmdcheck") |
| 44 | + shell: Rscript {0} |
| 45 | + |
| 46 | + - name: Check |
| 47 | + env: |
| 48 | + _R_CHECK_CRAN_INCOMING_REMOTE_: false |
| 49 | + run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check") |
| 50 | + shell: Rscript {0} |
| 51 | + |
| 52 | + |
| 53 | + - name: Build pkgdown |
| 54 | + run: | |
| 55 | + PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site(".")' |
| 56 | +
|
| 57 | + # deploy needs rsync? Seems so. |
| 58 | + - name: Install deploy dependencies |
| 59 | + run: | |
| 60 | + apt-get update |
| 61 | + apt-get -y install rsync |
| 62 | +
|
| 63 | + - name: Deploy 🚀 |
| 64 | + uses: JamesIves/github-pages-deploy-action@releases/v3 |
| 65 | + with: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + BRANCH: gh-pages # The branch the action should deploy to. |
| 68 | + FOLDER: docs # The folder the action should deploy. |
| 69 | + |
| 70 | + - uses: docker/build-push-action@v1 |
| 71 | + with: |
| 72 | + # The two entries below need to be entered as |
| 73 | + # github secrets. The "secret" names are "DOCKER_USERNAME" |
| 74 | + # and "DOCKER_PASSWORD". See https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository |
| 75 | + # for detailed instructions. |
| 76 | + # |
| 77 | + # DO NOT EDIT THESE ENTRIES HERE. Doing so will |
| 78 | + # expose your docker username and password on github. |
| 79 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 80 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 81 | + # Use the environment variable on first few lines to set repo name--just centralizes changes |
| 82 | + repository: ${{ env.repo-name }} |
| 83 | + tag_with_ref: true |
| 84 | + tag_with_sha: true |
| 85 | + tags: latest |
0 commit comments