Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update github action with Sean's template #2

Merged
merged 1 commit into from
May 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 32 additions & 24 deletions .github/workflows/basic_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
on: [push]
on: [push, pull_request]

env:
cache-version: v1
repo-name: jmacdon/bioc2021anno

jobs:
job1:
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel
steps:
- uses: actions/checkout@v1

- name: Query dependencies
- name: Query dependencies and update old packages
run: |
install.packages('remotes')
BiocManager::install(ask=FALSE)
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

Expand All @@ -17,8 +22,8 @@ jobs:
uses: actions/cache@v1
with:
path: /usr/local/lib/R/site-library
key: ${{ runner.os }}-r-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-1-
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-

# This lets us augment with additional dependencies
- name: Install system dependencies
Expand All @@ -31,28 +36,19 @@ jobs:
sudo -s eval "$sysreqs"

- name: Install dependencies
# mother of god I hate this tidyverse crap
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
run: |
options(repos = c(CRAN = "https://cran.r-project.org"))
BiocManager::repositories()
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories())
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "error", check_dir = "check")
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: jmacdon/bioc2021anno
tag_with_ref: true
tag_with_sha: true
tags: latest


- name: Build pkgdown
run: |
Expand All @@ -64,15 +60,27 @@ jobs:
apt-get update
apt-get -y install rsync

- name: Install SSH Client
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
SSH: true

- uses: docker/build-push-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
# The two entries below need to be entered as
# github secrets. The "secret" names are "DOCKER_USERNAME"
# and "DOCKER_PASSWORD". See https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository
# for detailed instructions.
#
# DO NOT EDIT THESE ENTRIES HERE. Doing so will
# expose your docker username and password on github.
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Use the environment variable on first few lines to set repo name--just centralizes changes
repository: ${{ env.repo-name }}
tag_with_ref: true
tag_with_sha: true
tags: latest