Skip to content

Commit f1abe59

Browse files
committed
merge next branch changes
1 parent bf682df commit f1abe59

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy AI Org Chart Builder Demo
2+
3+
on:
4+
push:
5+
branches: [ main, next ]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '18'
18+
cache: 'npm'
19+
20+
- name: Install Dependencies
21+
run: npm install
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to Custom Registry
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ${{ secrets.CUSTOM_REGISTRY_URL }}
30+
username: ${{ secrets.REGISTRY_USERNAME }}
31+
password: ${{ secrets.REGISTRY_TOKEN }}
32+
33+
- name: Build and Push Docker Image
34+
uses: docker/build-push-action@v6
35+
with:
36+
context: .
37+
file: Dockerfile
38+
push: true
39+
tags: ${{ secrets.CUSTOM_REGISTRY_URL }}/ai-org-chart-builder:${{ github.ref_name }}
40+
41+
- name: Trigger Server Restart Webhook
42+
run: |
43+
if [ "${{ github.ref_name }}" = "main" ]; then
44+
curl -X POST "${{ secrets.WEBHOOK_URL_MAIN }}"
45+
elif [ "${{ github.ref_name }}" = "next" ]; then
46+
curl -X POST "${{ secrets.WEBHOOK_URL_NEXT }}"
47+
fi

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:16-slim
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json ./
6+
RUN npm install --production && npm cache clean --force
7+
8+
COPY . .
9+
10+
EXPOSE 3001
11+
12+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)