Skip to content

Commit 8decdec

Browse files
committed
Add VM deploy workflow
1 parent a238c9f commit 8decdec

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/VM Deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: VM Deploy NodeBB
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build-and-deploy:
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Node.js version
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '20.17.0'
25+
26+
- name: Deploy via SSH
27+
uses: appleboy/ssh-action@v1.2.1
28+
with:
29+
host: ${{ secrets.SERVER_IP }}
30+
username: ${{ secrets.SERVER_ADMIN }}
31+
password: ${{ secrets.ADMIN_PASSWORD }}
32+
script: |
33+
cd code/${{ secrets.REPO_NAME }}
34+
git pull origin main
35+
docker compose down
36+
docker compose --profile redis up --build -d

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
services:
22
nodebb:
3+
user: "0"
34
build: .
45
# image: ghcr.io/nodebb/nodebb:latest
56
restart: unless-stopped
67
ports:
78
- '4567:4567' # comment this out if you don't want to expose NodeBB to the host, or change the first number to any port you want
89
volumes:
10+
911
- nodebb-build:/usr/src/app/build
1012
- nodebb-uploads:/usr/src/app/public/uploads
1113
- nodebb-config:/opt/config

0 commit comments

Comments
 (0)