Skip to content

feat: Add UI Orchestrator #3

feat: Add UI Orchestrator

feat: Add UI Orchestrator #3

name: Build Orchestrator
on:
push:
branches:
- main
paths:
- 'orchestrator/**'
- '.github/workflows/build-orchestrator.yml'
tags:
- 'v*.*.*'
pull_request:
paths:
- 'orchestrator/**'
- '.github/workflows/build-orchestrator.yml'
workflow_dispatch:
inputs:
force_push:
description: 'Force push the image even if in PR'
type: boolean
default: false
required: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/orchestrator
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
if: github.event_name != 'pull_request' || inputs.force_push
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./orchestrator
push: ${{ (github.event_name != 'pull_request' || inputs.force_push) == true }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max