-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 996 Bytes
/
ruby.yml
File metadata and controls
44 lines (39 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Ruby
on:
push:
branches: [main]
paths:
- ruby/Dockerfile
pull_request:
paths:
- ruby/Dockerfile
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/ruby
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
ruby-version:
- "3.3.10"
- "3.4.8"
- "4.0.1"
steps:
- uses: actions/checkout@v6
- uses: docker/login-action@v4
if: github.event_name != 'pull_request'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v7
with:
context: ruby
build-args: RUBY_VERSION=${{ matrix.ruby-version }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.ruby-version }}