Skip to content

Commit 7a04149

Browse files
committed
Add Github Action
1 parent 75d6cf7 commit 7a04149

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- pyproject.toml
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Docker image to GitHub Packages
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read # required for actions/checkout
16+
packages: write # required for pushing to ghcr.io
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v4
20+
21+
- name: Extract version
22+
id: extract_version
23+
run: echo "VERSION=$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
24+
25+
- name: Log in to GitHub Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v5
34+
with:
35+
context: .
36+
push: true
37+
tags: |
38+
ghcr.io/sysdiglabs/sysdig-mcp-server:latest
39+
ghcr.io/sysdiglabs/sysdig-mcp-server:v${{ env.VERSION }}

0 commit comments

Comments
 (0)