Skip to content

Build and Push Dev Images #3

Build and Push Dev Images

Build and Push Dev Images #3

Workflow file for this run

name: Build and Push Dev Images
on:
workflow_dispatch:
inputs:
image:
description: 'Image to build (leave empty for all)'
required: false
type: choice
options:
- ''
- base
- go
- rust
- java
- dotnet
- ruby
version:
description: 'Version override (only used when single image selected)'
required: false
type: string
tag:
description: 'Tag override (only used when single image selected)'
required: false
type: string
env:
REGISTRY: docker.io
jobs:
build-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: dev-base
key: base
tag: "1"
- repo: dev-go
key: go
tag: "1.23"
go: "true"
go_version: "1.23.4"
- repo: dev-rust
key: rust
tag: "1.83"
rust: "true"
rust_version: "1.83.0"
- repo: dev-java
key: java
tag: "21"
java: "true"
java_version: "21"
- repo: dev-dotnet
key: dotnet
tag: "8.0"
dotnet: "true"
dotnet_version: "8.0"
- repo: dev-ruby
key: ruby
tag: "3.3"
ruby: "true"
ruby_version: "3.3"
steps:
- name: Skip if not selected
if: ${{ inputs.image != '' && inputs.image != matrix.key }}
run: echo "Skipping ${{ matrix.key }}" && exit 0
- uses: actions/checkout@v4
if: ${{ inputs.image == '' || inputs.image == matrix.key }}
- name: Set up Docker Buildx
if: ${{ inputs.image == '' || inputs.image == matrix.key }}
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ inputs.image == '' || inputs.image == matrix.key }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
if: ${{ inputs.image == '' || inputs.image == matrix.key }}
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
tags: warpdotdev/${{ matrix.repo }}:${{ inputs.tag || matrix.tag }}
build-args: |
INSTALL_RUST=${{ matrix.rust || 'false' }}
INSTALL_GO=${{ matrix.go || 'false' }}
INSTALL_JAVA=${{ matrix.java || 'false' }}
INSTALL_DOTNET=${{ matrix.dotnet || 'false' }}
INSTALL_RUBY=${{ matrix.ruby || 'false' }}
GO_VERSION=${{ matrix.key == 'go' && inputs.version || matrix.go_version || '1.23.4' }}
RUST_VERSION=${{ matrix.key == 'rust' && inputs.version || matrix.rust_version || '1.85.0' }}
JAVA_VERSION=${{ matrix.key == 'java' && inputs.version || matrix.java_version || '21' }}
DOTNET_VERSION=${{ matrix.key == 'dotnet' && inputs.version || matrix.dotnet_version || '8.0' }}
RUBY_VERSION=${{ matrix.key == 'ruby' && inputs.version || matrix.ruby_version || '3.3' }}
cache-from: type=gha
cache-to: type=gha,mode=max