Skip to content

Commit

Permalink
Set Ruby version for Dockerfile from .ruby-version
Browse files Browse the repository at this point in the history
  • Loading branch information
pezholio committed Nov 19, 2024
1 parent 332a0c5 commit 07b0d67
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/rails-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ jobs:
run: |
rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq '[.[] | select(.number | test("beta") | not)] | group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 5)' | jq -s -c)
echo "RAILS_VERSIONS=$rails_versions" >> $GITHUB_OUTPUT
set-ruby-version:
runs-on: ubuntu-latest
name: Set Rails versions
outputs:
RAILS_VERSIONS: ${{ steps.set-ruby-version.outputs.RUBY_VERSION }}
steps:
- id: set-ruby-version
name: Set Ruby version
run: |
echo "RUBY_VERSION=$(cat .ruby-version)" >> $GITHUB_OUTPUT
build-rails:
strategy:
fail-fast: false
Expand All @@ -28,7 +38,9 @@ jobs:
rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
runs-on: ubuntu-latest
name: Build and cache Docker containers
needs: set-matrix
needs:
- set-matrix
- set-ruby-version
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -42,6 +54,7 @@ jobs:
build-args: |
RAILS_VERSION=${{ matrix.rails }}
MAIL_NOTIFY_BRANCH=${{ github.ref }}
RUBY_VERSION=${{ needs.set-ruby-version.outputs.RUBY_VERSION }}
push: false
tags: mail-notify-integration-rails-${{ matrix.rails }}:latest
outputs: type=docker, dest=/tmp/rails-${{ matrix.rails }}-image.tar
Expand All @@ -61,6 +74,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- set-matrix
- set-ruby-version
- build-rails
steps:
- name: Download image
Expand All @@ -85,6 +99,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- set-matrix
- set-ruby-version
- build-rails
steps:
- name: Download image
Expand Down

0 comments on commit 07b0d67

Please sign in to comment.