diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index ed0adbd..6dd286c 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -9,24 +9,39 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ghcr.io/${{ github.repository }} + LATEST_VERSION: 4.4.2 jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + + strategy: + matrix: + r_version: + - 4.2.3 + - 4.3.3 + - 4.4.2 steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 - name: Build - run: make --no-builtin-rules build + run: make --no-builtin-rules build R_VERSION=${{ matrix.r_version }} - name: Unit Tests - run: make --no-builtin-rules test + run: make --no-builtin-rules test R_VERSION=${{ matrix.r_version }} - - name: Log into registry + - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -34,4 +49,8 @@ jobs: - name: Publish images if: github.event_name != 'pull_request' - run: make --no-builtin-rules push + run: make --no-builtin-rules push R_VERSION=${{ matrix.r_version }} + + - name: Publish latest images + if: github.event_name != 'pull_request' && env.LATEST_VERSION == matrix.r_version + run: make --no-builtin-rules push-latest R_VERSION=${{ matrix.r_version }} diff --git a/Dockerfile b/Dockerfile index 710c68f..3398c58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG UBUNTU_VERSION +ARG UBUNTU_VERSION=latest FROM ubuntu:$UBUNTU_VERSION ARG R_VERSION @@ -27,6 +27,7 @@ RUN apt-get update -q \ gnupg2 \ libbz2-dev \ libcurl4-openssl-dev \ + libdeflate-dev \ libicu-dev \ liblzma-dev \ libpcre2-dev \ @@ -36,6 +37,8 @@ RUN apt-get update -q \ libxml2-dev \ locales \ lsb-release \ + pandoc \ + pandoc-citeproc \ perl \ software-properties-common \ sudo \ @@ -76,17 +79,6 @@ RUN curl -sSL "https://yihui.org/tinytex/install-bin-unix.sh" | sh \ && /opt/TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin \ && /opt/TinyTeX/bin/*/tlmgr path add -# install pandoc -RUN mkdir -p /opt/pandoc \ - && curl -sSL https://files.r-hub.io/pandoc/linux-64/pandoc.gz -o /opt/pandoc/pandoc.gz \ - && gzip -d /opt/pandoc/pandoc.gz \ - && chmod +x /opt/pandoc/pandoc \ - && ln -s /opt/pandoc/pandoc /usr/bin/pandoc \ - && curl -sSL https://files.r-hub.io/pandoc/linux-64/pandoc-citeproc.gz -o /opt/pandoc/pandoc-citeproc.gz \ - && gzip -d /opt/pandoc/pandoc-citeproc.gz \ - && chmod +x /opt/pandoc/pandoc-citeproc \ - && ln -s /opt/pandoc/pandoc-citeproc /usr/bin/pandoc-citeproc - # install R RUN apt-get update -q \ && apt-get install -qy --no-install-recommends \ diff --git a/Dockerfile.build b/Dockerfile.build index 9aef657..56933ee 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,4 +1,4 @@ -ARG BASE_IMAGE +ARG BASE_IMAGE=provide-via-build-arg FROM $BASE_IMAGE diff --git a/Dockerfile.plumber b/Dockerfile.plumber index cd95b38..1e71bca 100644 --- a/Dockerfile.plumber +++ b/Dockerfile.plumber @@ -1,4 +1,4 @@ -ARG BASE_IMAGE +ARG BASE_IMAGE=provide-via-build-arg FROM $BASE_IMAGE diff --git a/Dockerfile.shiny b/Dockerfile.shiny index 9cd8682..3cbe631 100644 --- a/Dockerfile.shiny +++ b/Dockerfile.shiny @@ -1,4 +1,4 @@ -ARG BASE_IMAGE +ARG BASE_IMAGE=provide-via-build-arg FROM $BASE_IMAGE diff --git a/Makefile b/Makefile index 918b2d1..351c724 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ export .PHONY: build build: - # "base" image docker build \ --pull \ @@ -48,7 +47,6 @@ build: .PHONY: test test: - # smoke test images, before running units docker run --tty --rm $(IMAGE_TAG) R --no-save -e "capabilities()" docker run --tty --rm $(IMAGE_TAG)-build R --no-save -e "capabilities()" @@ -60,18 +58,19 @@ test: .PHONY: push push: - - docker push $(IMAGE_NAME):latest + # image names contain R version docker push $(IMAGE_TAG) - - docker push $(IMAGE_NAME):build docker push $(IMAGE_TAG)-build - - docker push $(IMAGE_NAME):shiny docker push $(IMAGE_TAG)-shiny + docker push $(IMAGE_TAG)-plumber +.PHONY: push-latest +push-latest: + # images labelled as "latest" + docker push $(IMAGE_NAME):latest + docker push $(IMAGE_NAME):build + docker push $(IMAGE_NAME):shiny docker push $(IMAGE_NAME):plumber - docker push $(IMAGE_TAG)-plumber # adapted from https://stackoverflow.com/a/48782113/30521 env-%: diff --git a/README.md b/README.md index 3334b6e..50f1ac2 100644 --- a/README.md +++ b/README.md @@ -374,7 +374,10 @@ available on [GitHub Container Registry][ghcr], including: | Ubuntu Version | R Version | Base Tag | Build Tag | Shiny Tag | Plumber Tag | |----------------|-----------|---------------|---------------|---------------|-----------------| -| `22.04` | `4.2.2` | `latest` | `build` | `shiny` | `plumber` | +| `22.04` | `4.4.2` | `latest` | `build` | `shiny` | `plumber` | +| `22.04` | `4.4.2` | | `4.4.2-build` | `4.4.2-shiny` | `4.4.2-plumber` | +| `22.04` | `4.3.3` | | `4.3.3-build` | `4.3.3-shiny` | `4.3.3-plumber` | +| `22.04` | `4.2.3` | | `4.2.3-build` | `4.2.3-shiny` | `4.2.3-plumber` | | `22.04` | `4.2.2` | | `4.2.2-build` | `4.2.2-shiny` | `4.2.2-plumber` | | `22.04` | `4.2.1` | | `4.2.1-build` | `4.2.1-shiny` | `4.2.1-plumber` | diff --git a/test/units/test.R b/test/units/test.R index 89c92ef..c4e1b01 100644 --- a/test/units/test.R +++ b/test/units/test.R @@ -47,7 +47,7 @@ tryCatch(capabilities(), warning = function(w) { # Check graphics devices # https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/Devices.html for (dev_name in c("png", "jpeg", "tiff", "svg", "bmp", "pdf", "postscript", - "xfig", "pictex", "cairo_pdf", "cairo_ps")) { + "cairo_pdf", "cairo_ps")) { # Skip unsupported graphics devices (e.g. tiff in R >= 3.3 on CentOS 6) if (dev_name %in% names(capabilities()) && capabilities(dev_name) == FALSE) { next