-
Notifications
You must be signed in to change notification settings - Fork 9
150 lines (133 loc) · 4.54 KB
/
build.yml
File metadata and controls
150 lines (133 loc) · 4.54 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Build Docker image
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build-group:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- ruby-0.x-1.6
- ruby-1.8.6-1.8.7
- ruby-1.9
- ruby-2.0
- ruby-2.1
- ruby-2.2
- ruby-2.3
- ruby-2.4
- ruby-2.5
- ruby-2.6
- ruby-2.7
- ruby-3.0
- ruby-3.1
- ruby-3.2
- ruby-3.3
- ruby-3.4
- ruby-3.5-4.0
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and push ${{ matrix.target }}
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
target: ${{ matrix.target }}
push: true
tags: docker.io/rubylang/all-ruby:${{ matrix.target }}
cache-from: |
type=registry,ref=docker.io/rubylang/all-ruby:cache-${{ matrix.target }}
cache-to: |
type=registry,ref=docker.io/rubylang/all-ruby:cache-${{ matrix.target }},mode=max
build-merge:
needs: build-group
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: ruby-0.x-2.4
tag: ruby-0.x-2.4
- target: ruby-2.5-3.1
tag: ruby-2.5-3.1
- target: ruby-3.2-4.0
tag: ruby-3.2-4.0
steps:
- name: Remove unnecessary files to release disk space
run: |
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/ghc \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and push ${{ matrix.target }}
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: Dockerfile.final
target: ${{ matrix.target }}
push: true
tags: docker.io/rubylang/all-ruby:${{ matrix.tag }}
build-latest:
needs: build-merge
runs-on: ubuntu-latest
steps:
- name: Remove unnecessary files to release disk space
run: |
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/ghc \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_ACCESS_TOKEN }}
- name: Build and push latest image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: Dockerfile.final
push: true
tags: |
docker.io/rubylang/all-ruby:latest
ghcr.io/ruby/all-ruby:latest