Skip to content

Refactor to eliminate runtime type assertions #59

Refactor to eliminate runtime type assertions

Refactor to eliminate runtime type assertions #59

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches: [ main ]
tags: [ 'v*' ]
workflow_dispatch:
env:
REGISTRY: docker.io
IMAGE_NAME: mcp-front
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 Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/dgellow/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=main-,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
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: Extract metadata for docker-client variant
id: meta-docker
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/dgellow/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=docker-client-latest,enable={{is_default_branch}}
type=sha,prefix=docker-client-,enable={{is_default_branch}}
- name: Build and push Docker client image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.docker-client
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-docker.outputs.tags }}
labels: ${{ steps.meta-docker.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max