Skip to content

Commit

Permalink
Another attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
dedene committed Jul 4, 2024
1 parent e090d2c commit 9ddd04c
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
include:
- os: ubuntu-latest
platform: linux/amd64
# - os: ubuntu-22.04-arm
# platform: linux/arm64
- os: ubuntu-22.04-arm
platform: linux/arm64

permissions:
id-token: write # keyless Cosign signatures
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
echo "branch=$(echo ${GIT_REF,,} | sed 's/[^a-zA-Z0-9]/-/g')" | tee -a $GITHUB_OUTPUT
- name: Generate Docker metadata with ruby version
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
id: metadata
with:
flavor: |
Expand Down Expand Up @@ -101,7 +101,6 @@ jobs:
uses: docker/build-push-action@v6
id: build
with:
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
BUILD_AT=${{ steps.prepare.outputs.today }}
Expand Down Expand Up @@ -152,14 +151,37 @@ jobs:
pattern: digests-${{ matrix.ruby }}-${{ matrix.debian }}-*
merge-multiple: true

- name: Parse ruby version
id: prepare
run: |
RUBY_VERSION=$(grep -Eo 'RUBY_VERSION ${{ matrix.ruby }}.[0-9]+$' Dockerfile | cut -d ' ' -f2)
MAJOR=$(echo $RUBY_VERSION | cut -d . -f 1)
MINOR=$(echo $RUBY_VERSION | cut -d . -f 2)
PATCH=$(echo $RUBY_VERSION | cut -d . -f 3)
TODAY=$(date +%Y-%m-%d)
echo "major=$MAJOR" | tee -a $GITHUB_OUTPUT
echo "minor=$MINOR" | tee -a $GITHUB_OUTPUT
echo "patch=$PATCH" | tee -a $GITHUB_OUTPUT
echo "version=$RUBY_VERSION" | tee -a $GITHUB_OUTPUT
echo "today=${TODAY}" | tee -a $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
- name: Generate Docker metadata with ruby version
uses: docker/metadata-action@v5
id: metadata
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=${{ matrix.ruby == '3.3' }}
images: |
docker.io/${{ env.REGISTRY_IMAGE }}
ghcr.io/${{ env.REGISTRY_IMAGE }}
tags: |
type=semver,pattern={{version}},value=v${{ steps.prepare.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=v${{ steps.prepare.outputs.version }}
labels: |
org.opencontainers.image.title=ruby
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down

0 comments on commit 9ddd04c

Please sign in to comment.