Skip to content

Commit 63811f2

Browse files
authored
CI: pass secrets to container (#9)
* ci: pass secrets to container * Update readme
1 parent 704f072 commit 63811f2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/test-and-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ jobs:
4545
platforms: linux/amd64
4646

4747
- name: Start agent container
48+
env:
49+
SECRETS_JSON: ${{ toJson(secrets) }}
4850
run: |
49-
docker run -d -p 9009:9009 --name agent-container $(echo "${{ steps.meta.outputs.tags }}" | head -n1) --host 0.0.0.0 --port 9009
51+
echo "$SECRETS_JSON" | jq -r 'to_entries[] | "\(.key)=\(.value)"' > .env
52+
docker run -d -p 9009:9009 --name agent-container --env-file .env $(echo "${{ steps.meta.outputs.tags }}" | head -n1) --host 0.0.0.0 --port 9009
5053
timeout 30 bash -c 'until curl -sf http://localhost:9009/.well-known/agent-card.json > /dev/null; do sleep 1; done'
5154
5255
- name: Set up uv

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ src/
1010
├─ executor.py # A2A request handling
1111
├─ agent.py # Your agent implementation goes here
1212
└─ messenger.py # A2A messaging utilities
13+
tests/
14+
└─ test_agent.py # Agent tests
1315
Dockerfile # Docker configuration
1416
pyproject.toml # Python dependencies
15-
uv.lock # Locked dependencies
17+
.github/
18+
└─ workflows/
19+
└─ test-and-publish.yml # CI workflow
1620
```
1721

1822
## Getting Started
@@ -23,6 +27,8 @@ uv.lock # Locked dependencies
2327

2428
3. **Configure your agent card** - Fill in your agent's metadata (name, skills, description) in [`src/server.py`](src/server.py)
2529

30+
4. **Write your tests** - Add custom tests for your agent in [`tests/test_agent.py`](tests/test_agent.py)
31+
2632
## Running Locally
2733

2834
```bash
@@ -59,7 +65,9 @@ uv run pytest --agent-url http://localhost:9009
5965

6066
## Publishing
6167

62-
The repository includes a GitHub Actions workflow that automatically builds, tests, and publishes a Docker image of your agent to GitHub Container Registry:
68+
The repository includes a GitHub Actions workflow that automatically builds, tests, and publishes a Docker image of your agent to GitHub Container Registry.
69+
70+
If your agent needs API keys or other secrets, add them in Settings → Secrets and variables → Actions → Repository secrets. They'll be available as environment variables during CI tests.
6371

6472
- **Push to `main`** → publishes `latest` tag:
6573
```

0 commit comments

Comments
 (0)