Skip to content

Commit ec93bb2

Browse files
committed
update docker
1 parent 0120e4d commit ec93bb2

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

.github/workflows/docker.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
docker:
1313
name: Build & Push Docker Image
1414
runs-on: ubuntu-latest
15+
# Only run if the release workflow completed successfully or a release was published
1516
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'release' }}
1617
steps:
1718
- name: Checkout
@@ -24,29 +25,40 @@ jobs:
2425
id: meta
2526
uses: docker/metadata-action@v4
2627
with:
27-
images: ghcr.io/${{ github.repository }}
28+
images: watercrawl/mcp
2829
tags: |
2930
type=semver,pattern={{version}}
3031
type=semver,pattern={{major}}.{{minor}}
3132
type=semver,pattern={{major}}
3233
type=sha,format=short
33-
type=ref,event=branch
34+
latest
3435
3536
- name: Set up Docker Buildx
3637
uses: docker/setup-buildx-action@v2
3738

38-
- name: Login to GitHub Container Registry
39+
- name: Check if Docker Hub secrets exist
40+
id: check-secrets
41+
run: |
42+
if [ -n "${{ secrets.DOCKER_USERNAME }}" ] && [ -n "${{ secrets.DOCKER_PASSWORD }}" ]; then
43+
echo "has_docker_secrets=true" >> $GITHUB_OUTPUT
44+
else
45+
echo "has_docker_secrets=false" >> $GITHUB_OUTPUT
46+
fi
47+
48+
- name: Login to Docker Hub
3949
uses: docker/login-action@v2
50+
# Only run this step if Docker Hub credentials are available
51+
if: steps.check-secrets.outputs.has_docker_secrets == 'true'
4052
with:
41-
registry: ghcr.io
42-
username: ${{ github.actor }}
43-
password: ${{ secrets.GITHUB_TOKEN }}
53+
username: ${{ secrets.DOCKER_USERNAME }}
54+
password: ${{ secrets.DOCKER_PASSWORD }}
4455

4556
- name: Build and push
4657
uses: docker/build-push-action@v4
4758
with:
4859
context: .
49-
push: true
60+
# Only push if Docker Hub credentials are available
61+
push: ${{ steps.check-secrets.outputs.has_docker_secrets == 'true' }}
5062
tags: ${{ steps.meta.outputs.tags }}
5163
labels: ${{ steps.meta.outputs.labels }}
5264
cache-from: type=gha

PUBLISHING.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,29 @@ To add this token to GitHub:
2929
5. Value: Paste your npm token
3030
6. Click "Add secret"
3131

32-
### 2. `GITHUB_TOKEN`
32+
### 2. `DOCKER_USERNAME` and `DOCKER_PASSWORD`
33+
34+
These secrets are used to publish Docker images to Docker Hub.
35+
36+
To set up Docker Hub credentials:
37+
38+
1. Create or log in to your Docker Hub account at [hub.docker.com](https://hub.docker.com/)
39+
2. Create an access token under Account Settings > Security
40+
3. Add these secrets to your GitHub repository:
41+
- `DOCKER_USERNAME`: Your Docker Hub username
42+
- `DOCKER_PASSWORD`: Your Docker Hub access token
43+
44+
### 3. `GITHUB_TOKEN`
3345

3446
This is automatically provided by GitHub Actions, so you don't need to configure it manually.
3547

36-
## Docker Hub Configuration (Optional)
48+
## Docker Hub Configuration
3749

38-
If you want to publish to Docker Hub instead of or in addition to GitHub Container Registry:
50+
Before your first release, make sure to:
3951

40-
1. Create a Docker Hub access token
41-
2. Add `DOCKER_USERNAME` and `DOCKER_PASSWORD` secrets to GitHub
42-
3. Modify the docker.yml workflow to use Docker Hub
52+
1. Create a repository named `watercrawl/mcp` on Docker Hub
53+
2. Set appropriate visibility and description for your Docker image
54+
3. Verify that your Docker Hub user has push permissions for this repository
4355

4456
## Configuring npm for Scoped Package
4557

@@ -71,16 +83,16 @@ Include `BREAKING CHANGE:` in the commit body or footer to trigger a major versi
7183

7284
## Docker Usage
7385

74-
The Docker image is built automatically and published to GitHub Container Registry.
86+
The Docker image is built automatically and published to Docker Hub.
7587

7688
To use the Docker image:
7789

7890
```bash
7991
# Pull the image
80-
docker pull ghcr.io/watercrawl/watercrawl-mcp:latest
92+
docker pull watercrawl/mcp:latest
8193

8294
# Run the container
83-
docker run -p 3000:3000 -e WATERCRAWL_API_KEY=your-api-key ghcr.io/watercrawl/watercrawl-mcp:latest
95+
docker run -p 3000:3000 -e WATERCRAWL_API_KEY=your-api-key watercrawl/mcp:latest
8496

8597
# Or use docker-compose
8698
docker-compose up

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.8'
22

33
services:
44
watercrawl-mcp:
5-
image: ghcr.io/watercrawl/watercrawl-mcp:latest
5+
image: watercrawl/mcp:latest
66
container_name: watercrawl-mcp
77
environment:
88
- WATERCRAWL_API_KEY=${WATERCRAWL_API_KEY}

0 commit comments

Comments
 (0)