Skip to content

Build w/ Bookworm (R 3.0.0 - ) #11

Build w/ Bookworm (R 3.0.0 - )

Build w/ Bookworm (R 3.0.0 - ) #11

name: Build w/ Bookworm (R 3.0.0 - )
on:
workflow_dispatch:
inputs:
inpwhichcont:
description: 'Which R versions to build, defaults to "all".'
required: false
default: 'all'
type: string
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.setup-matrix.outputs.containers }}
steps:
- uses: actions/checkout@v3
- name: Set up matrix of containers
id: setup-matrix
run: |
inp="${{ github.event.inputs.inpwhichcont }}"
if [ "x$inp" == "xall" -o "x$inp" == "x" ]; then
out="$(cat containers/versions-bookworm.txt | tr '\n' ',' | sed 's/,$//')"
else
out=$inp
fi
cnt="$(echo '["'$out'"]' | tr -d ' ' | sed 's/,/","/g')"
echo "containers=$cnt" >> $GITHUB_OUTPUT
containers:
needs: setup-matrix
strategy:
fail-fast: false
matrix:
container: ${{ fromJson(needs.setup-matrix.outputs.containers) }}
runs-on: ubuntu-latest
name: R ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
context: "{{defaultContext}}:containers"
file: Dockerfile-bookworm
build-args: |
R_VERSION=${{ matrix.container }}
push: true
provenance: false
tags: ghcr.io/r-hub/evercran/${{ matrix.container }},rhub/evercran:${{ matrix.container}},docker.io/rhub/evercran:${{ matrix.container }}