Skip to content

Build w/ Sarge (- R 2.5.1) #26

Build w/ Sarge (- R 2.5.1)

Build w/ Sarge (- R 2.5.1) #26

Workflow file for this run

name: Build w/ Sarge (- R 2.5.1)
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/prerelease-versions.txt containers/sarge-versions.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/i386
context: "{{defaultContext}}:containers"
file: Dockerfile-sarge
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 }}