Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit d8534f0

Browse files
authored
feat: gh action deploy (#803)
* feat: gh action deploy * feat: caprover captain file * fix: gh deploy action * fix: docker image path * fix: deploy only on new package
1 parent 33cb728 commit d8534f0

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/deploy

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build & Deploy
2+
3+
on:
4+
registry_package:
5+
types: [published]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [18.x]
14+
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
cache: "npm"
23+
- run: npm ci
24+
- run: npm run build --if-present
25+
- run: npm run test --if-present
26+
27+
- uses: a7ul/tar-action@v1.1.0
28+
with:
29+
command: c
30+
cwd: "./"
31+
files: |
32+
backend/
33+
frontend/dist/
34+
captain-definition
35+
outPath: deploy.tar
36+
37+
- name: Deploy App to CapRover
38+
uses: caprover/deploy-from-github@v1.0.1
39+
with:
40+
server: '${{ secrets.CAPROVER_SERVER }}'
41+
app: eddie-bot
42+
token: '${{ secrets.CAPROVER_TOKEN }}'

captain-definition

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"schemaVersion": 2,
3+
"imageName": "ghcr.io/eddiehubcommunity/eddiebot:latest"
4+
}

0 commit comments

Comments
 (0)