Skip to content

Commit 645bf44

Browse files
committed
chore(meridian): add docker publishing
1 parent 85be037 commit 645bf44

2 files changed

Lines changed: 102 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build and Push Meridian Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "apps/meridian/**"
9+
- "packages/**"
10+
- ".github/workflows/meridian-docker.yml"
11+
workflow_dispatch:
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository_owner }}/meridian
16+
17+
jobs:
18+
build-and-push:
19+
runs-on: blacksmith-8vcpu-ubuntu-2404
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v6
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Log in to GitHub Container Registry
32+
uses: docker/login-action@v4
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract metadata for Docker
39+
id: meta
40+
uses: docker/metadata-action@v6
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
tags: |
44+
type=ref,event=branch
45+
type=sha,prefix={{branch}}-
46+
type=raw,value=latest,enable={{is_default_branch}}
47+
48+
- name: Build and push Docker image
49+
uses: docker/build-push-action@v7
50+
with:
51+
context: .
52+
file: ./apps/meridian/Dockerfile
53+
platforms: linux/amd64
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max
59+
60+
- name: Delete old Docker images
61+
uses: actions/delete-package-versions@v5
62+
with:
63+
package-name: meridian
64+
package-type: container
65+
min-versions-to-keep: 2
66+
token: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Trigger Dokploy Deployment
69+
run: |
70+
curl -X POST \
71+
'${{ secrets.DOKPLOY_DOMAIN }}/api/application.deploy' \
72+
-H 'accept: application/json' \
73+
-H 'x-api-key: ${{ secrets.DOKPLOY_API_KEY }}' \
74+
-H 'Content-Type: application/json' \
75+
-d '{"applicationId": "${{ secrets.MERIDIAN_APPLICATION_ID }}"}'

‎apps/meridian/Dockerfile‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM oven/bun:1.3-alpine AS base
2+
WORKDIR /app
3+
4+
# Copy all package.json files for layer caching
5+
COPY package.json bun.lock turbo.json ./
6+
COPY apps/meridian/package.json apps/meridian/
7+
COPY packages/stratus/package.json packages/stratus/
8+
COPY packages/types/package.json packages/types/
9+
COPY packages/ui/package.json packages/ui/
10+
11+
RUN bun install
12+
13+
# Copy source
14+
COPY packages/stratus packages/stratus
15+
COPY packages/types packages/types
16+
COPY packages/ui packages/ui
17+
COPY apps/meridian apps/meridian
18+
19+
RUN bun run build:meridian
20+
21+
FROM oven/bun:1.3-alpine
22+
WORKDIR /app
23+
COPY --from=base /app/apps/meridian/.output .output
24+
25+
ENV NODE_ENV=production
26+
EXPOSE 3000/tcp
27+
ENTRYPOINT ["bun", "--bun", "run", "/app/.output/server/index.mjs"]

0 commit comments

Comments
 (0)