Skip to content

Commit b7984dc

Browse files
committed
Update GHA workflow for scheduled build for awesome-copilot
1 parent b9cc849 commit b7984dc

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

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

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

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

88
jobs:
99
build-and-push-image-stdio:

.github/workflows/build-container.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
attestations: write
2525
id-token: write
2626

27+
env:
28+
BUILD_IMAGE: true
29+
2730
steps:
2831
- name: Checkout repository
2932
uses: actions/checkout@v4
@@ -81,12 +84,14 @@ jobs:
8184
8285
if git diff --staged --quiet; then
8386
echo "No changes to commit"
87+
echo "BUILD_IMAGE=false" >> $GITHUB_ENV
8488
else
8589
git commit -m "Update metadata.json"
8690
git push origin main
8791
fi
8892
8993
- name: Check if Dockerfile exists
94+
if: env.BUILD_IMAGE == 'true'
9095
id: check-dockerfile
9196
shell: bash
9297
run: |
@@ -97,26 +102,33 @@ jobs:
97102
fi
98103
99104
- name: Log in to the Container registry
100-
if: steps.check-dockerfile.outputs.exists == 'true'
105+
if: |
106+
env.BUILD_IMAGE == 'true' &&
107+
steps.check-dockerfile.outputs.exists == 'true'
101108
uses: docker/login-action@v3
102109
with:
103110
registry: ${{ env.REGISTRY }}
104111
username: ${{ github.actor }}
105112
password: ${{ secrets.GITHUB_TOKEN }}
106113

107114
- name: Extract metadata (tags, labels) for Docker
108-
if: steps.check-dockerfile.outputs.exists == 'true'
115+
if: |
116+
env.BUILD_IMAGE == 'true' &&
117+
steps.check-dockerfile.outputs.exists == 'true'
109118
id: meta
110119
uses: docker/metadata-action@v5
111120
with:
112121
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}
113122

114123
- name: Set up Docker Buildx
115-
if: steps.check-dockerfile.outputs.exists == 'true'
124+
if: |
125+
env.BUILD_IMAGE == 'true' &&
126+
steps.check-dockerfile.outputs.exists == 'true'
116127
uses: docker/setup-buildx-action@v3
117128

118129
- name: Build and push Docker image - multi-platform
119130
if: |
131+
env.BUILD_IMAGE == 'true' &&
120132
steps.check-dockerfile.outputs.exists == 'true' &&
121133
steps.platform.outputs.supports_multiplatform == 'true'
122134
id: push-multiplatform
@@ -131,6 +143,7 @@ jobs:
131143

132144
- name: Generate artifact attestation - multi-platform
133145
if: |
146+
env.BUILD_IMAGE == 'true' &&
134147
steps.check-dockerfile.outputs.exists == 'true' &&
135148
steps.platform.outputs.supports_multiplatform == 'true'
136149
uses: actions/attest-build-provenance@v2
@@ -141,6 +154,7 @@ jobs:
141154

142155
- name: Build and push Docker image - amd64 only
143156
if: |
157+
env.BUILD_IMAGE == 'true' &&
144158
steps.check-dockerfile.outputs.exists == 'true' &&
145159
steps.platform.outputs.supports_multiplatform == 'false'
146160
id: push-amd64
@@ -155,6 +169,7 @@ jobs:
155169

156170
- name: Generate artifact attestation - amd64 only
157171
if: |
172+
env.BUILD_IMAGE == 'true' &&
158173
steps.check-dockerfile.outputs.exists == 'true' &&
159174
steps.platform.outputs.supports_multiplatform == 'false'
160175
uses: actions/attest-build-provenance@v2

0 commit comments

Comments
 (0)