unity-runner/.gitea/workflows/create-image.yaml
Guillaume Langlois 1774e03472
Some checks failed
🤓 Individual Runners / Build 🐳 windows-mono (push) Failing after 1m13s
Refactor Docker login process to use PIPELINES_PASSWORD for authentication
2026-02-03 10:11:03 -05:00

132 lines
4.6 KiB
YAML

name: 🤓 Individual Runners
on:
push:
branches: [main]
paths:
- versions.txt
- dockerfiles/runner.dockerfile
- .gitea/workflows/create-image.yaml
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
jobs:
build-docker:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY_DOMAIN: gitea.clubconjure.com
DOCKER_REGISTRY: gitea.clubconjure.com/${{ github.repository_owner }}/
UNITY_VERSION: ${{ github.event.inputs.unity_version }}
GAMECI_OS: ubuntu
GAMECI_VERSION: 3
strategy:
max-parallel: 2
matrix:
platform:
- windows-mono
name: Build 🐳 ${{ matrix.platform }}
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == '' || github.event.inputs.platform == matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Test connectivity
run: |
echo "Testing connection to registry..."
time curl -v --max-time 30 https://${{ env.DOCKER_REGISTRY_DOMAIN }}/v2/ || true
- name: Check secrets
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
PIPELINES_USERNAME: ${{ secrets.PIPELINES_USERNAME }}
run: |
echo "Username length: ${#PIPELINES_USERNAME}"
echo "Token length: ${#REGISTRY_TOKEN}"
if [ -z "$PIPELINES_USERNAME" ]; then echo "ERROR: PIPELINES_USERNAME is empty!"; fi
if [ -z "$REGISTRY_TOKEN" ]; then echo "ERROR: REGISTRY_TOKEN is empty!"; fi
- name: Login to the Container registry
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
PIPELINES_USERNAME: ${{ secrets.PIPELINES_USERNAME }}
DOCKER_CLIENT_TIMEOUT: 300
COMPOSE_HTTP_TIMEOUT: 300
run: |
set -x # Enable command tracing
echo "=== Docker Login Debug ==="
echo "Registry: ${{ env.DOCKER_REGISTRY_DOMAIN }}"
echo "Username: ${PIPELINES_USERNAME}"
echo "Starting login attempt at $(date)"
# Check Docker version and configuration
echo "=== Docker Info ==="
docker version
docker info
# Try with verbose curl first to see the full auth flow
echo "=== Testing /v2/ endpoint with auth ==="
curl -u "${PIPELINES_USERNAME}:${PIPELINES_PASSWORD}" -v "https://${{ env.DOCKER_REGISTRY_DOMAIN }}/v2/" 2>&1 || true
echo ""
echo "=== Enable Docker CLI debug ==="
export DOCKER_CLI_DEBUG=1
echo "=== Now attempting Docker login ==="
timeout 120 bash -c "echo '${PIPELINES_PASSWORD}' | docker --debug login '${{ env.DOCKER_REGISTRY_DOMAIN }}' -u '${PIPELINES_USERNAME}' --password-stdin 2>&1" || {
EXIT_CODE=$?
echo "Docker login failed with exit code: $EXIT_CODE"
if [ $EXIT_CODE -eq 124 ]; then
echo "Login timed out after 120 seconds"
fi
echo ""
echo "=== Docker daemon logs (if accessible) ==="
sudo journalctl -u docker -n 50 --no-pager 2>/dev/null || echo "Cannot access docker logs"
exit $EXIT_CODE
}
echo "Login completed at $(date)"
- name: Get Unity Version
if: ${{ github.event.inputs.unity_version == '' }}
run: |
VERSION=$(head -n 1 versions.txt)
echo "UNITY_VERSION=$VERSION" >> $GITHUB_ENV
echo "Unity Version: $VERSION"
- name: Docker Build
run: .gitea/workflows/scripts/build-runner-image.sh
id: build-image
env:
UNITY_VERSION: ${{ env.UNITY_VERSION }}
UNITY_MODULES: ${{ matrix.platform }}
GAMECI_VERSION: ${{ env.GAMECI_VERSION }}
GAMECI_OS: ${{ env.GAMECI_OS }}
IMAGE: ${{ env.DOCKER_REGISTRY }}unityci/editor
TAG: ${{ env.GAMECI_OS }}-${{ env.UNITY_VERSION }}-${{ matrix.platform }}-runner
- name: Docker Push
run: |
echo "Pushing Docker Image ${{ steps.build-image.outputs.FULL_IMAGE }}"
echo "- Image: ${{ steps.build-image.outputs.IMAGE }}"
echo "- Tag: ${{ steps.build-image.outputs.TAG }}"
docker push ${{ steps.build-image.outputs.FULL_IMAGE }}