Skip to content

Commit 3ca4c39

Browse files
committed
ci: add deploy job and docker-compose for site
Adds self-hosted runner deploy job (labels: graphmemory, site) to site-docker.yml and docker-compose.yml for the Docusaurus site with configurable SITE_IMAGE and SITE_LISTEN.
1 parent 58ac9f0 commit 3ca4c39

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/site-docker.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
permissions:
1818
contents: read
1919
packages: write
20+
outputs:
21+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
2022

2123
steps:
2224
- uses: actions/checkout@v6
@@ -54,3 +56,26 @@ jobs:
5456
push: true
5557
tags: ${{ steps.meta.outputs.tags }}
5658
labels: ${{ steps.meta.outputs.labels }}
59+
60+
deploy:
61+
needs: build-and-push
62+
runs-on: [self-hosted, graphmemory, site]
63+
permissions:
64+
packages: read
65+
steps:
66+
- uses: actions/checkout@v6
67+
68+
- name: Log in to Container Registry
69+
uses: docker/login-action@v4
70+
with:
71+
registry: ${{ env.REGISTRY }}
72+
username: ${{ github.actor }}
73+
password: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Deploy
76+
run: |
77+
docker compose -f site/docker-compose.yml pull
78+
docker compose -f site/docker-compose.yml up -d
79+
env:
80+
SITE_IMAGE: ${{ needs.build-and-push.outputs.image }}
81+
SITE_LISTEN: ${{ vars.SITE_LISTEN }}

site/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
site:
3+
image: ${SITE_IMAGE:-ghcr.io/graph-memory/graphmemory-site:latest}
4+
restart: unless-stopped
5+
ports:
6+
- "${SITE_LISTEN:-127.0.0.1:80}:80"

0 commit comments

Comments
 (0)