Skip to content

Commit 45f5cb6

Browse files
authored
Merge pull request #170 from buyua9/ci/publish-docker-image-buyua9
ci: publish backend image to GHCR
2 parents 97a04d9 + d87fe32 commit 45f5cb6

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: publish docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
publish-backend-image:
15+
runs-on: ubuntu-latest
16+
name: Publish backend image to GHCR
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to GHCR
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract Docker metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ghcr.io/${{ github.repository_owner }}/openmemory
37+
tags: |
38+
type=ref,event=tag
39+
type=sha,prefix=sha-
40+
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
41+
42+
- name: Build and push backend image
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: ./packages/openmemory-js
46+
file: ./packages/openmemory-js/Dockerfile
47+
push: true
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)