Skip to content

Commit f18af75

Browse files
committed
Change Docker release to manual workflow dispatch
Remove automatic Docker image build on push to main. Add new manual release workflow that can be triggered via GitHub Actions UI. Changes: - Add .github/workflows/release.yml for manual releases via workflow_dispatch - Remove docker job from .github/workflows/python-tests.yml - Update docs/development.md with new release process The new workflow allows: - Specifying custom version or using version from __init__.py - Optionally tagging as latest - Building multi-arch images (amd64, arm64) - Publishing to Docker Hub and GitHub Container Registry - Creating GitHub releases automatically
1 parent cfbc478 commit f18af75

File tree

3 files changed

+108
-50
lines changed

3 files changed

+108
-50
lines changed

.github/workflows/python-tests.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -65,49 +65,3 @@ jobs:
6565
uv run pytest --run-api-tests
6666
env:
6767
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
68-
69-
docker:
70-
needs: test
71-
runs-on: ubuntu-latest
72-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
73-
steps:
74-
- name: Checkout
75-
uses: actions/checkout@v4
76-
77-
- name: Set up Docker Buildx
78-
uses: docker/setup-buildx-action@v3
79-
80-
- name: Log in to Docker Hub
81-
uses: docker/login-action@v3
82-
with:
83-
username: ${{ secrets.DOCKER_USERNAME }}
84-
password: ${{ secrets.DOCKER_TOKEN }}
85-
86-
- name: Log in to GitHub Container Registry
87-
uses: docker/login-action@v3
88-
with:
89-
registry: ghcr.io
90-
username: ${{ github.actor }}
91-
password: ${{ secrets.GITHUB_TOKEN }}
92-
93-
- name: Extract version from __init__.py
94-
id: version
95-
run: |
96-
VERSION=$(grep '__version__ =' agent_memory_server/__init__.py | sed 's/__version__ = "\(.*\)"/\1/' || echo "latest")
97-
echo "version=$VERSION" >> $GITHUB_OUTPUT
98-
echo "Version: $VERSION"
99-
100-
- name: Build and push Docker image
101-
uses: docker/build-push-action@v5
102-
with:
103-
context: .
104-
file: ./Dockerfile
105-
platforms: linux/amd64,linux/arm64
106-
push: true
107-
tags: |
108-
redislabs/agent-memory-server:latest
109-
redislabs/agent-memory-server:${{ steps.version.outputs.version }}
110-
ghcr.io/${{ github.repository }}:latest
111-
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}
112-
cache-from: type=gha
113-
cache-to: type=gha,mode=max

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Release Docker Images
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (leave empty to use version from __init__.py)'
8+
required: false
9+
type: string
10+
push_latest:
11+
description: 'Also tag as latest'
12+
required: true
13+
type: boolean
14+
default: true
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Log in to Docker Hub
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKER_USERNAME }}
30+
password: ${{ secrets.DOCKER_TOKEN }}
31+
32+
- name: Log in to GitHub Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Determine version
40+
id: version
41+
run: |
42+
if [ -n "${{ inputs.version }}" ]; then
43+
VERSION="${{ inputs.version }}"
44+
else
45+
VERSION=$(grep '__version__ =' agent_memory_server/__init__.py | sed 's/__version__ = "\(.*\)"/\1/' || echo "latest")
46+
fi
47+
echo "version=$VERSION" >> $GITHUB_OUTPUT
48+
echo "Version to release: $VERSION"
49+
50+
- name: Build tags list
51+
id: tags
52+
run: |
53+
TAGS="redislabs/agent-memory-server:${{ steps.version.outputs.version }}"
54+
TAGS="$TAGS,ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}"
55+
56+
if [ "${{ inputs.push_latest }}" = "true" ]; then
57+
TAGS="$TAGS,redislabs/agent-memory-server:latest"
58+
TAGS="$TAGS,ghcr.io/${{ github.repository }}:latest"
59+
fi
60+
61+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
62+
echo "Tags to push: $TAGS"
63+
64+
- name: Build and push Docker image
65+
uses: docker/build-push-action@v5
66+
with:
67+
context: .
68+
file: ./Dockerfile
69+
platforms: linux/amd64,linux/arm64
70+
push: true
71+
tags: ${{ steps.tags.outputs.tags }}
72+
cache-from: type=gha
73+
cache-to: type=gha,mode=max
74+
75+
- name: Create GitHub Release
76+
uses: actions/create-release@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
tag_name: v${{ steps.version.outputs.version }}
81+
release_name: Release v${{ steps.version.outputs.version }}
82+
body: |
83+
Docker images published:
84+
- `redislabs/agent-memory-server:${{ steps.version.outputs.version }}`
85+
- `ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}`
86+
${{ inputs.push_latest && format('- `redislabs/agent-memory-server:latest`{0}- `ghcr.io/{1}:latest`', '\n ', github.repository) || '' }}
87+
draft: false
88+
prerelease: false

docs/development.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,27 @@ uv run pytest
2424

2525
## Releasing Agent Memory Server
2626

27-
Merging a PR to the main branch will trigger building and pushing a new image
28-
to Docker Hub based on the commits in main (including the version number).
29-
Currently, that image pushes to a test project:
27+
Releases are triggered manually via GitHub Actions workflow dispatch.
3028

31-
https://hub.docker.com/r/redislabs/agent-memory-server
29+
### Steps to Release
30+
31+
1. Update the version in `agent_memory_server/__init__.py`
32+
2. Commit and push the version change to main
33+
3. Go to GitHub Actions → "Release Docker Images" workflow
34+
4. Click "Run workflow"
35+
5. Choose options:
36+
- **Version**: Leave empty to use version from `__init__.py`, or specify a custom version
37+
- **Push latest tag**: Check to also tag as `latest` (recommended for stable releases)
38+
6. Click "Run workflow"
39+
40+
This will:
41+
- Build Docker images for linux/amd64 and linux/arm64
42+
- Push to Docker Hub: `redislabs/agent-memory-server:<version>`
43+
- Push to GitHub Container Registry: `ghcr.io/redis/agent-memory-server:<version>`
44+
- Optionally tag as `latest` on both registries
45+
- Create a GitHub release with the version tag
46+
47+
Docker Hub: https://hub.docker.com/r/redislabs/agent-memory-server
3248

3349

3450
## Releasing Agent Memory Client

0 commit comments

Comments
 (0)