@@ -19,18 +19,50 @@ permissions:
1919jobs :
2020 build-and-push :
2121 runs-on : ubuntu-latest
22+ strategy :
23+ matrix :
24+ ruby_image :
25+ - ruby:2.7.8-slim-bullseye
26+ - ruby:3.0.7-slim-bullseye
27+ - ruby:3.1.7-slim-bookworm
28+ - ruby:3.2.9-slim-bookworm
29+ - ruby:3.3.9-slim-bookworm
30+ - ruby:3.4.5-slim-bookworm
31+
2232 steps :
2333 - name : Check out current commit
2434 uses : actions/checkout@v4
2535
36+ - name : Generate short image name
37+ id : image_name
38+ run : |
39+ ruby_image="${{ matrix.ruby_image }}"
40+
41+ if [[ "$ruby_image" == ruby:* ]]; then
42+ version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
43+ short_name="sentry-ruby-devcontainer-${version}"
44+ elif [[ "$ruby_image" == jruby:latest ]]; then
45+ short_name="sentry-ruby-devcontainer-jruby-latest"
46+ elif [[ "$ruby_image" == jruby:* ]]; then
47+ version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
48+ short_name="sentry-ruby-devcontainer-jruby-${version}"
49+ else
50+ short_name="sentry-ruby-devcontainer-${ruby_image}"
51+ fi
52+
53+ echo "short_name=${short_name}" >> $GITHUB_OUTPUT
54+ echo "Generated short image name: ${short_name}"
55+
2656 - name : Build and push devcontainer image
2757 id : build
2858 uses : getsentry/action-build-and-push-images@main
2959 with :
30- image_name : ' sentry-ruby-devcontainer-build '
60+ image_name : ' ${{ steps.image_name.outputs.short_name }} '
3161 dockerfile_path : ' .devcontainer/Dockerfile'
3262 ghcr : true
3363 publish_on_pr : true
64+ build_args : |
65+ IMAGE=${{ matrix.ruby_image }}
3466
3567 - name : Use outputs
3668 run : |
0 commit comments