Skip to content

Commit b9cc849

Browse files
committed
Update GHA workflows
1 parent 49dcebd commit b9cc849

File tree

4 files changed

+49
-11
lines changed

4 files changed

+49
-11
lines changed

.github/workflows/build-awesome-copilot.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build MCP Server - Awesome Copilot
22

33
on:
44
workflow_dispatch:
5+
# schedule:
6+
# - cron: '0 * * * *' # Every hour at minute 0
57

68
jobs:
79
build-and-push-image-stdio:

.github/workflows/build-container.yaml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ jobs:
2828
- name: Checkout repository
2929
uses: actions/checkout@v4
3030

31+
- name: Identify multi-platform support
32+
id: platform
33+
shell: bash
34+
run: |
35+
if [ "${{ inputs.image_name }}" = "todo-list" ]; then
36+
echo "supports_multiplatform=false" >> $GITHUB_OUTPUT
37+
else
38+
echo "supports_multiplatform=true" >> $GITHUB_OUTPUT
39+
fi
40+
3141
- name: Pull the latest metadata.json
3242
if: inputs.image_name == 'awesome-copilot'
3343
shell: bash
@@ -105,9 +115,11 @@ jobs:
105115
if: steps.check-dockerfile.outputs.exists == 'true'
106116
uses: docker/setup-buildx-action@v3
107117

108-
- name: Build and push Docker image
109-
if: steps.check-dockerfile.outputs.exists == 'true'
110-
id: push
118+
- name: Build and push Docker image - multi-platform
119+
if: |
120+
steps.check-dockerfile.outputs.exists == 'true' &&
121+
steps.platform.outputs.supports_multiplatform == 'true'
122+
id: push-multiplatform
111123
uses: docker/build-push-action@v6
112124
with:
113125
platforms: linux/amd64,linux/arm64
@@ -117,10 +129,36 @@ jobs:
117129
tags: '${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:${{ inputs.extension }}'
118130
labels: ${{ steps.meta.outputs.labels }}
119131

120-
- name: Generate artifact attestation
121-
if: steps.check-dockerfile.outputs.exists == 'true'
132+
- name: Generate artifact attestation - multi-platform
133+
if: |
134+
steps.check-dockerfile.outputs.exists == 'true' &&
135+
steps.platform.outputs.supports_multiplatform == 'true'
136+
uses: actions/attest-build-provenance@v2
137+
with:
138+
subject-name: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}
139+
subject-digest: ${{ steps.push-multiplatform.outputs.digest }}
140+
push-to-registry: true
141+
142+
- name: Build and push Docker image - amd64 only
143+
if: |
144+
steps.check-dockerfile.outputs.exists == 'true' &&
145+
steps.platform.outputs.supports_multiplatform == 'false'
146+
id: push-amd64
147+
uses: docker/build-push-action@v6
148+
with:
149+
platforms: linux/amd64
150+
push: true
151+
context: ${{ github.workspace }}/${{ inputs.image_name }}
152+
file: ${{ github.workspace }}/${{ inputs.image_name }}/Dockerfile.${{ inputs.extension }}
153+
tags: '${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:${{ inputs.extension }}'
154+
labels: ${{ steps.meta.outputs.labels }}
155+
156+
- name: Generate artifact attestation - amd64 only
157+
if: |
158+
steps.check-dockerfile.outputs.exists == 'true' &&
159+
steps.platform.outputs.supports_multiplatform == 'false'
122160
uses: actions/attest-build-provenance@v2
123161
with:
124162
subject-name: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}
125-
subject-digest: ${{ steps.push.outputs.digest }}
163+
subject-digest: ${{ steps.push-amd64.outputs.digest }}
126164
push-to-registry: true

awesome-copilot/.vscode/mcp.stdio.container.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"run",
88
"-i",
99
"--rm",
10-
"mcp-awesome-copilot-stdio:latest",
11-
"-tc",
12-
"-p"
10+
"mcp-awesome-copilot-stdio:latest"
1311
]
1412
}
1513
}

todo-list/Dockerfile.http

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
44

5-
COPY . /source
5+
COPY ./src/McpTodoList.ContainerApp /source/McpTodoList.ContainerApp
66

7-
WORKDIR /source/src/McpTodoList.ContainerApp
7+
WORKDIR /source/McpTodoList.ContainerApp
88

99
ARG TARGETARCH
1010
RUN case "$TARGETARCH" in \

0 commit comments

Comments
 (0)