Build Docker image #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.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@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 | |
| 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@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.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@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 | |
| 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@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.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@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 | |
| with: | |
| context: . | |
| file: Dockerfile.final | |
| push: true | |
| tags: | | |
| docker.io/rubylang/all-ruby:latest | |
| ghcr.io/ruby/all-ruby:latest |