Skip to content

MCP Server

MCP Server #130

Workflow file for this run

name: Build and Push Images
on:
push:
branches:
- '**'
tags:
- '**'
paths:
- 'images/**'
- 'mie-opensource-landing/**'
- 'Makefile'
pull_request:
types: [opened, synchronize, reopened, closed]
paths:
- 'images/**'
- 'mie-opensource-landing/**'
- 'Makefile'
schedule:
# Run weekly on Sunday at 11:00 PM UTC (Sunday-Monday night depending on timezone)
- cron: '0 23 * * 0'
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
if: github.event_name != 'pull_request' || github.event.action != 'closed'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Meta (Base)
id: meta-base
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/base
bake-target: base
tags: |
type=sha
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Docker Meta (NodeJS)
id: meta-nodejs
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/nodejs
bake-target: nodejs
tags: |
type=sha
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Docker Meta (Docs)
id: meta-docs
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/docs
bake-target: docs
tags: |
type=sha
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Docker Meta (Agent)
id: meta-agent
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/agent
bake-target: agent
tags: |
type=sha
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Docker Meta (Manager)
id: meta-manager
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/manager
bake-target: manager
tags: |
type=sha
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push
uses: docker/bake-action@v5
with:
workdir: ./images
push: true
files: |
./docker-bake.hcl
${{ steps.meta-base.outputs.bake-file }}
${{ steps.meta-nodejs.outputs.bake-file }}
${{ steps.meta-docs.outputs.bake-file }}
${{ steps.meta-agent.outputs.bake-file }}
${{ steps.meta-manager.outputs.bake-file }}
set: |
base.cache-from=type=gha,scope=base-${{ github.ref_name }}
base.cache-to=type=gha,mode=max,scope=base-${{ github.ref_name }}
nodejs.cache-from=type=gha,scope=nodejs-${{ github.ref_name }}
nodejs.cache-to=type=gha,mode=max,scope=nodejs-${{ github.ref_name }}
docs.cache-from=type=gha,scope=docs-${{ github.ref_name }}
docs.cache-to=type=gha,mode=max,scope=docs-${{ github.ref_name }}
agent.cache-from=type=gha,scope=agent-${{ github.ref_name }}
agent.cache-to=type=gha,mode=max,scope=agent-${{ github.ref_name }}
manager.cache-from=type=gha,scope=manager-${{ github.ref_name }}
manager.cache-to=type=gha,mode=max,scope=manager-${{ github.ref_name }}
deploy-preview:
if: github.event.action != 'closed'
needs: build-and-push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mieweb/launchpad@cmyers_issue5
with:
api_key: ${{ secrets.API_KEY }}
api_url: ${{ secrets.API_URL }}
template_name: ${{ env.REGISTRY }}/${{ github.repository }}/docs:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}
cleanup-preview:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Remove preview container
uses: mieweb/launchpad@cmyers_issue5
with:
api_key: ${{ secrets.LAUNCHPAD_API_KEY }}
api_url: ${{ secrets.LAUNCHPAD_API_URL }}