Skip to content

Commit

Permalink
add matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
wael-sadek committed Oct 3, 2024
1 parent 1b7c348 commit c383497
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
attestations: write
id-token: write
#
strategy:
matrix:
images: [tofutf, rig-ubuntu, rig-rocky8]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -30,20 +33,20 @@ jobs:
- name: Extract metadata (tags, labels) for Docker
id: meta
run: |
echo "tag=$(head -1 tofutf | cut -d: -f2)" >> "$GITHUB_OUTPUT"
echo "tag=$(head -1 ${{ matrix.image }} | cut -d: -f2)" >> "$GITHUB_OUTPUT"
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: tofutf
file: ${{ matrix.image }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}/tofutf:${{ steps.meta.outputs.tag }}
tags: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}/${{ matrix.image }}:${{ steps.meta.outputs.tag }}

# # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}/tofutf
# subject-name: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}/${{ matrix.image }}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
16 changes: 16 additions & 0 deletions rig-rocky8
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM rockylinux:8

RUN dnf update -y

RUN dnf install -y curl sudo

# Set locale
RUN dnf install -y glibc-langpack-en

RUN curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-latest.tar.gz | sudo tar xz -C /usr/local

RUN mkdir /root/.R && echo 'MAKEFLAGS=-j4' > /root/.R/Makevars

RUN rig add release && rig add devel

WORKDIR /root/workspace
23 changes: 23 additions & 0 deletions rig-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y curl sudo locales ccache

# https://stackoverflow.com/a/28406007/946850
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen

ENV LANG en_US.UTF-8

ENV LANGUAGE en_US:en

ENV LC_ALL en_US.UTF-8

RUN /usr/sbin/update-ccache-symlinks

RUN curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-latest.tar.gz | sudo tar xz -C /usr/local

RUN mkdir /root/.R && echo 'MAKEFLAGS=-j4' > /root/.R/Makevars

RUN rig add release && rig add devel

WORKDIR /root/workspace

0 comments on commit c383497

Please sign in to comment.