Skip to content

Merge pull request #29 from virtualstaticvoid/feat/build-multiple-r-v… #14

Merge pull request #29 from virtualstaticvoid/feat/build-multiple-r-v…

Merge pull request #29 from virtualstaticvoid/feat/build-multiple-r-v… #14

Workflow file for this run

name: Build & Publish
on:
push:
tags: [ '*.*.*' ]
pull_request:
branches: [ "main" ]
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@v4
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build
run: make --no-builtin-rules build R_VERSION=${{ matrix.r_version }}
- name: Unit Tests
run: make --no-builtin-rules test R_VERSION=${{ matrix.r_version }}
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish images
if: github.event_name != 'pull_request'
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 }}