Skip to content

Commit cc5aec0

Browse files
committed
ci(docker): publish fork image to GHCR + fix registry releaser
1 parent e62aa0b commit cc5aec0

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ env:
3030

3131
jobs:
3232
build:
33-
runs-on: ubuntu-latest-xl
33+
runs-on: ubuntu-latest
3434
permissions:
3535
contents: read
3636
packages: write

.github/workflows/registry-releaser.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
permissions:
1212
id-token: write # Required for OIDC authentication
1313
contents: read
14+
packages: read
1415

1516
steps:
1617
- name: Checkout code
@@ -20,7 +21,7 @@ jobs:
2021
uses: actions/setup-go@v6
2122
with:
2223
go-version: "stable"
23-
24+
2425
- name: Fetch tags
2526
run: |
2627
if [[ "${{ github.ref_type }}" != "tag" ]]; then
@@ -29,21 +30,30 @@ jobs:
2930
echo "Skipping tag fetch - already on tag ${{ github.ref_name }}"
3031
fi
3132
33+
- name: Log into GHCR
34+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
3240
- name: Wait for Docker image
3341
run: |
3442
if [[ "${{ github.ref_type }}" == "tag" ]]; then
3543
TAG="${{ github.ref_name }}"
3644
else
3745
TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n1)
3846
fi
39-
IMAGE="ghcr.io/github/github-mcp-server:$TAG"
40-
47+
48+
REPO="${GITHUB_REPOSITORY,,}"
49+
IMAGE="ghcr.io/${REPO}:$TAG"
50+
4151
for i in {1..10}; do
4252
if docker manifest inspect "$IMAGE" &>/dev/null; then
43-
echo "✅ Docker image ready: $TAG"
53+
echo "✅ Docker image ready: $IMAGE"
4454
break
4555
fi
46-
[ $i -eq 10 ] && { echo "❌ Timeout waiting for $TAG after 5 minutes"; exit 1; }
56+
[ $i -eq 10 ] && { echo "❌ Timeout waiting for $IMAGE after 5 minutes"; exit 1; }
4757
echo "⏳ Waiting for Docker image ($i/10)..."
4858
sleep 30
4959
done
@@ -80,4 +90,4 @@ jobs:
8090
run: ./mcp-publisher login github-oidc
8191

8292
- name: Publish to MCP Registry
83-
run: ./mcp-publisher publish
93+
run: ./mcp-publisher publish

docs/DOCKER_GHCR_FORK.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Docker images for this fork (GHCR)
2+
3+
This repository publishes Docker images to **GitHub Container Registry**.
4+
5+
- **Image**: `ghcr.io/redorangesweater/github-mcp-server`
6+
- **Common tags**:
7+
- **`main`**: latest build from `main`
8+
- **`sha-<...>`**: immutable build tag for a specific commit
9+
- **`vX.Y.Z`**: release tag builds
10+
- **`latest`**: only for stable `vX.Y.Z` tags (no pre-releases)
11+
12+
### Pull
13+
14+
```bash
15+
docker pull ghcr.io/redorangesweater/github-mcp-server:main
16+
```
17+
18+
### Run
19+
20+
```bash
21+
docker run -i --rm \
22+
-e GITHUB_PERSONAL_ACCESS_TOKEN=... \
23+
ghcr.io/redorangesweater/github-mcp-server:main
24+
```
25+
26+
### Notes
27+
28+
- If you see `denied` errors while pulling, run `docker logout ghcr.io` and try again (stale credentials can override public access).
29+
- Package visibility is controlled under GitHub **Packages** settings for the org/repo.

0 commit comments

Comments
 (0)