Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit cfff08d

Browse files
authored
update the docker workflow to run on release (#37)
1 parent 163baf8 commit cfff08d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/build-and-push.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
name: Build and Push MCP Server
1+
name: Build and Push Docker Image
22

33
on:
4+
release:
5+
types: [created]
46
workflow_dispatch:
57
inputs:
68
VERSION:
@@ -17,6 +19,19 @@ jobs:
1719
steps:
1820
- name: Check out code
1921
uses: actions/checkout@v4
22+
23+
- name: Set version
24+
id: version
25+
run: |
26+
if [ "${{ github.event_name }}" = "release" ]; then
27+
# Strip 'v' prefix from release tag if present
28+
VERSION="${{ github.event.release.tag_name }}"
29+
VERSION="${VERSION#v}"
30+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
31+
else
32+
echo "VERSION=${{ inputs.VERSION }}" >> $GITHUB_OUTPUT
33+
fi
34+
2035
- name: Login to Docker Hub
2136
uses: docker/login-action@v3
2237
with:
@@ -35,6 +50,6 @@ jobs:
3550
platforms: linux/amd64,linux/arm64/v8
3651
push: true
3752
tags: |
38-
ghcr.io/port-labs/port-mcp-server:${{ inputs.VERSION }}
53+
ghcr.io/port-labs/port-mcp-server:${{ steps.version.outputs.VERSION }}
3954
ghcr.io/port-labs/port-mcp-server:latest
4055

0 commit comments

Comments
 (0)