version bump 0.99.14 #106
This file contains 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: Check, build, and push image | |
on: | |
push: | |
paths: | |
- 'DESCRIPTION' | |
- '**.yml' | |
branches: | |
- devel | |
pull_request: | |
env: | |
cache-version: v1 | |
jobs: | |
r-build-and-check: | |
runs-on: ubuntu-latest | |
container: bioconductor/bioconductor_docker:RELEASE_3_17 | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Query dependencies and update old packages | |
run: | | |
BiocManager::install("reticulate") | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
shell: Rscript {0} | |
- name: Cache R packages | |
if: runner.os != 'Windows' | |
uses: actions/cache@v3 | |
with: | |
path: /usr/local/lib/R/site-library | |
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r- | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Setup r-reticulate venv | |
shell: Rscript {0} | |
run: | | |
python_packages <- | |
c("numpy") | |
library(reticulate) | |
sessionInfo() | |
- name: Install R dependencies | |
run: | | |
BiocManager::repositories() | |
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories()) | |
BiocManager::install(ask = FALSE, update = TRUE) | |
shell: Rscript {0} | |
- name: Check | |
env: | |
_R_CHECK_CRAN_INCOMING_REMOTE_: false | |
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check") | |
shell: Rscript {0} | |
- name: Build pkgdown | |
if: github.event_name != 'pull_request' | |
run: | | |
PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site()' | |
# deploy needs rsync? Seems so. | |
- name: Install apt dependencies | |
if: github.event_name != 'pull_request' | |
run: | | |
apt-get update | |
apt-get -y install rsync | |
- name: Deploy 🚀 | |
if: success() && github.event_name != 'pull_request' | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: docs # The folder the action should deploy. | |
docker-build-and-push: | |
needs: r-build-and-check | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set Environment Variables | |
run: | | |
REPO_LOWER="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" | |
REGISTRY=ghcr.io | |
echo "BUILD_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV | |
echo "GIT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV | |
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV | |
echo "IMAGE=${REPO_LOWER}" >> $GITHUB_ENV | |
- name: Show environment | |
run: | | |
env | |
# Install the cosign tool except on PR | |
# https://github.com/sigstore/cosign-installer | |
- name: Install cosign | |
if: github.event_name != 'pull_request' | |
uses: sigstore/cosign-installer@1e95c1de343b5b0c23352d6417ee3e48d5bcd422 | |
with: | |
cosign-release: 'v1.4.0' | |
# Workaround: https://github.com/docker/build-push-action/issues/461 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf | |
- name: Log into registry ${{ env.REGISTRY }} | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Login against a Docker registry | |
- name: Log into docker.io registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE }} | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest | |
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.GIT_SHA }} | |
docker.io/${{ env.IMAGE }}:latest | |
docker.io/${{ env.IMAGE }}:${{ env.GIT_SHA }} |