Build w/ Squeeze (R 2.13.0 - R 2.15.3) #3
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: Build w/ Squeeze (R 2.13.0 - R 2.15.3) | |
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/squeeze-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-squeeze | |
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 }} |