-
Notifications
You must be signed in to change notification settings - Fork 4.2k
63 lines (53 loc) · 1.55 KB
/
docker-image.yml
File metadata and controls
63 lines (53 loc) · 1.55 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
53
54
55
56
57
58
59
60
61
62
63
name: CI - Build and push Docker images
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
packages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/awesome-copilot-mcp-server
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Restore
working-directory: ./mcp-server
run: dotnet restore src/AwesomeCopilot.McpServer/AwesomeCopilot.McpServer.csproj
- name: Run unit tests (if any)
working-directory: ./mcp-server
run: |
if [ -f "src/AwesomeCopilot.McpServer/Tests.csproj" ]; then
dotnet test --no-build --verbosity normal
else
echo "No tests found, skipping"
fi
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: ./mcp-server
file: ./mcp-server/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ github.sha }}
build-args: |
RUNTIME=linux-x64
- name: Image cleanup
run: docker image prune -f || true