Skip to content

GH: Added environment #19

GH: Added environment

GH: Added environment #19

name: 🏃‍♂️ Create Runners
on:
workflow_dispatch:
inputs:
unity_version:
description: 'Unity Version'
required: false
default: '6000.0.35f1'
type: string
platform:
description: 'Platform'
required: false
default: 'all'
type: choice
options:
- all
- webgl
- android
- ios
- mac-mono
- windows-mono
- linux-il2cpp
push:
branches: [main]
paths:
- versions.txt
- dockerfiles/runner.dockerfile
- .github/workflows/create-runner.yaml
env:
GAMECI_OS: ubuntu
GAMECI_VERSION: 3
jobs:
version:
runs-on: ubuntu-slim
name: 🧾 Check Unity Version
outputs:
UNITY_VERSION: ${{ steps.get-version.outputs.UNITY_VERSION }}
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: versions.txt
- name: Get Unity Version
id: get-version
run: |
VERSION="${{ github.event.inputs.unity_version }}"
if [ -z "$VERSION" ]; then
VERSION=$(head -n 1 versions.txt)
fi
echo "Unity Version: $VERSION"
echo "UNITY_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
needs: [ version ]
environment: "Docker Hub"
strategy:
matrix:
os:
- "$GAMECI_OS"
version:
- ${{ needs.version.outputs.UNITY_VERSION }}
platform:
- webgl
- android
- ios
- mac-mono
- windows-mono
- linux-il2cpp
name: ${{ matrix.version }} - ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6
- name: "⚙️ Setup Buildx"
uses: docker/setup-buildx-action@v3
- name: "🔑 Login to Docker registry"
uses: docker/login-action@v4
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "🐋 Build image"
uses: docker/build-push-action@v6
with:
context: .
file: dockerfiles/runner.dockerfile
build-args: |
VERSION=${{ matrix.version }}
BASE_IMAGE=unityci/editor:${{ matrix.os }}-${{ matrix.version }}-base-$GAMECI_VERSION
MODULE=${{ matrix.platform }}
tags: lachee/unity-runner:${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform }}-runner
push: true