-
Notifications
You must be signed in to change notification settings - Fork 12
133 lines (118 loc) · 4.24 KB
/
Copy pathdocker.yml
File metadata and controls
133 lines (118 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Docker Image (Build, Test & Push)
on:
pull_request:
branches: [main]
paths:
- "Dockerfile"
- ".dockerignore"
- "src/**"
- "package.json"
- "yarn.lock"
- "tests/docker/**"
- ".github/workflows/docker.yml"
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
IMAGE_NAME: localstack/localstack-mcp-server
jobs:
smoke:
runs-on: ubuntu-latest
env:
CI_LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image (single-arch, load locally)
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: ${{ env.IMAGE_NAME }}:ci
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Smoke test MCP startup
env:
HARNESS_SKIP: prompt,docs,status,start,aws,logs,state,cloudpods,appinspector,chaos,iam,replicator,ephemeral,deploy,deploy-cdk,extensions,restart,stop,snowflake
run: |
node tests/docker/validate-image.mjs -- \
docker run -i --rm \
${{ env.IMAGE_NAME }}:ci
- name: Integration test Docker runtime
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
HARNESS_TOKEN_REAL: ${{ secrets.LOCALSTACK_AUTH_TOKEN != '' && '1' || '0' }}
HARNESS_SKIP: cloudpods,ephemeral,replicator,chaos
run: |
npm ci --prefix data/sample-cdk
mkdir -p "$HOME/.localstack-mcp"
node tests/docker/validate-image.mjs -- \
docker run -i --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$HOME/.localstack-mcp:$HOME/.localstack-mcp" \
-e XDG_CACHE_HOME="$HOME/.localstack-mcp" \
--add-host host.docker.internal:host-gateway \
--add-host s3.host.docker.internal:host-gateway \
--add-host snowflake.localhost.localstack.cloud:host-gateway \
-e LOCALSTACK_AUTH_TOKEN \
-e LOCALSTACK_HOSTNAME=host.docker.internal \
-v "$PWD/data:/work/data" \
${{ env.IMAGE_NAME }}:ci
push:
name: Build & Push (multi-arch)
needs: smoke
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
runs-on: ubuntu-latest
environment:
name: docker-push
deployment: false
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
- name: Derive image tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
flavor: |
latest=false
- name: Build and push (linux/amd64, linux/arm64)
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Sync README to Docker Hub overview
if: github.ref == 'refs/heads/main'
continue-on-error: true
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
repository: ${{ env.IMAGE_NAME }}
readme-filepath: ./README.md