Repository navigation
52 lines (45 loc) · 2.13 KB
/
Copy pathdocker.yml
File metadata and controls
52 lines (45 loc) · 2.13 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
name: Publish Docker image
# On each published release, build the HTTP image from the Dockerfile,
# run the same smoke test as CI, and push it to GitHub Container Registry
# as ghcr.io/tmhsdigital/steam-mcp:<version> and :latest.
on:
release:
types: [published]
permissions:
contents: read
packages: write
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Build
run: |
version="${GITHUB_REF_NAME#v}"
image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/steam-mcp"
echo "VERSION=$version" >> "$GITHUB_ENV"
echo "IMAGE=$image" >> "$GITHUB_ENV"
docker build \
--label "org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}" \
--label "org.opencontainers.image.description=Steam MCP Server, Streamable HTTP transport" \
--label "org.opencontainers.image.licenses=CC-BY-ND-4.0" \
--label "org.opencontainers.image.version=$version" \
-t "$image:$version" -t "$image:latest" .
- name: Smoke test
run: |
docker run -d --name steam-mcp -p 3000:3000 -e STEAM_MCP_ALLOWED_HOSTS=127.0.0.1 \
-e STEAM_MCP_HTTP_TOKEN=ci-smoke-token-0123456789 "$IMAGE:$VERSION"
for i in $(seq 1 20); do curl -fs http://127.0.0.1:3000/healthz && break; sleep 1; done
# Without the bearer token the image must refuse MCP requests.
test "$(curl -s -o /dev/null -w '%{http_code}' -X POST http://127.0.0.1:3000/mcp)" = 401
curl -fs http://127.0.0.1:3000/mcp -H 'Authorization: Bearer ci-smoke-token-0123456789' \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | grep -q steam_getPlayerCount
docker rm -f steam-mcp
- name: Push
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "$GH_TOKEN" | docker login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
docker push "$IMAGE:$VERSION"
docker push "$IMAGE:latest"