Skip to content

Create docker build GHA #1

Create docker build GHA

Create docker build GHA #1

Workflow file for this run

name: Docker Build
on:
workflow_dispatch:
inputs:
tag_latest:
description: 'Tag as latest'
required: true
type: choice
options:
- 'true'
- 'false'
default: 'true'
push:
# temp disable branch filter for testing
#branches: [main]
paths:
- 'docker/**'
- 'scripts/setup_*.sh'
- 'src/holosoma_inference/docker/Dockerfile'
- 'src/holosoma_retargeting/docker/Dockerfile'
permissions:
contents: read
env:
ECR_REPO: 982423663241.dkr.ecr.us-west-2.amazonaws.com
jobs:
build:
strategy:
fail-fast: false # continue on one build failing
matrix:
environment:
# just inference for first version, quickest to build and debug issues in GHA
- inference
# - holosoma
# - retargeting
# - isaacsim
# - isaacgym
# - mujoco
#TODO: add mujoco warp
name: Build ${{ matrix.environment }} Docker Image
continue-on-error: true
runs-on: codebuild-holosoma-cpu-build-${{ github.run_id }}-${{ github.run_attempt }}
env:
# image name should be `holosoma` or `holsoma-${environment}`
IMAGE_NAME: ${{ matrix.environment == 'holosoma' && '' || 'holosoma-' }}${{ matrix.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Generate image tag
id: tag
run: echo "tag=$(date -u +%Y_%m%d_%H%M)" >> "$GITHUB_OUTPUT"
- name: Build Docker image
env:
IMAGE_TAG: ${{ steps.tag.outputs.tag }}
run: |
./docker/build_and_push.sh "${{ matrix.environment }}" \
"${{ inputs.tag_latest == 'true' && '--latest' || '' }}"
- name: Summary
run: |
echo "## Docker Build Summary" >> "$GITHUB_STEP_SUMMARY"
echo "- **Tag:** \`${{ steps.tag.outputs.tag }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- **Image:** \`${{ env.ECR_REPO }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}\`" >> "$GITHUB_STEP_SUMMARY"