Skip to content

Add REST API for InstaVM-compatible code execution #7

Add REST API for InstaVM-compatible code execution

Add REST API for InstaVM-compatible code execution #7

Workflow file for this run

name: Docker Multi-Platform Build
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
release:
types: [ published ]
env:
REGISTRY: docker.io
IMAGE_NAME: instavm/coderunner
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Tag with 'docker-latest' for main branch
type=raw,value=docker-latest,enable={{is_default_branch}}
# Tag with branch name + 'docker' suffix
type=ref,event=branch,suffix=-docker
# Tag PRs with pr-<number>-docker
type=ref,event=pr,suffix=-docker
# Tag releases with version + 'docker' suffix
type=semver,pattern={{version}}-docker
type=semver,pattern={{major}}.{{minor}}-docker
labels: |
org.opencontainers.image.title=CodeRunner Docker
org.opencontainers.image.description=CodeRunner MCP server for Docker/Linux environments
org.opencontainers.image.vendor=InstVM
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Generate build summary
run: |
echo "## Docker Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- **Platforms**: linux/amd64, linux/arm64" >> $GITHUB_STEP_SUMMARY
echo "- **Registry**: ${{ env.REGISTRY }}" >> $GITHUB_STEP_SUMMARY
echo "- **Image**: ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "- **Tags**: ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Usage Examples" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "# Run with Docker" >> $GITHUB_STEP_SUMMARY
echo "docker run -d -p 8222:8222 -v ./uploads:/app/uploads ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:docker-latest" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Run with Docker Compose" >> $GITHUB_STEP_SUMMARY
echo "# See docker-compose.yml in repository" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY