Skip to content

Commit 601abc6

Browse files
jmgrosenclaude
andcommitted
Add GitHub Actions workflow to build and push to GHCR
Builds the Docker image on pushes to main and publishes to ghcr.io/semgrep/memtrace-viewer-docker with latest and sha tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 61dbc72 commit 601abc6

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and push Docker image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: docker/login-action@v3
22+
with:
23+
registry: ${{ env.REGISTRY }}
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- uses: docker/metadata-action@v5
28+
id: meta
29+
with:
30+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
31+
tags: |
32+
type=sha
33+
type=raw,value=latest
34+
35+
- uses: docker/build-push-action@v6
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)