Compare commits
11 Commits
5e20b59284
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ca28c37ca | |||
| 7dbc5706ca | |||
| 07cb8717cb | |||
| 63ef4836a1 | |||
| b867280f70 | |||
| 2f02fee268 | |||
| ba9532eb82 | |||
| 012cd57ea0 | |||
| fd8211b7b2 | |||
| aed7fa1ce9 | |||
| 2f9f12d154 |
@@ -1,10 +0,0 @@
|
|||||||
name: Deploy
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Deploy
|
|
||||||
run: bash /opt/deploy-shop.sh server main
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
when:
|
|
||||||
branch: main
|
|
||||||
event: push
|
|
||||||
|
|
||||||
steps:
|
|
||||||
install:
|
|
||||||
image: node:20
|
|
||||||
commands:
|
|
||||||
- npm ci
|
|
||||||
|
|
||||||
lint:
|
|
||||||
image: node:20
|
|
||||||
commands:
|
|
||||||
- npm run lint
|
|
||||||
depends_on: [install]
|
|
||||||
|
|
||||||
build:
|
|
||||||
image: node:20
|
|
||||||
commands:
|
|
||||||
- npm run build
|
|
||||||
depends_on: [install]
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
image: alpine:latest
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache openssh rsync
|
|
||||||
- rsync -e "ssh -i /ssh/deploy_key" -avz --delete dist/ root@192.168.1.88:/srv/shop/
|
|
||||||
- ssh -i /ssh/deploy_key root@192.168.1.88 'systemctl restart shop-server'
|
|
||||||
secrets: [deploy_key]
|
|
||||||
depends_on: [lint, build]
|
|
||||||
+31
-20
@@ -1,30 +1,41 @@
|
|||||||
when:
|
when:
|
||||||
branch: main
|
event: [push, manual]
|
||||||
event: push
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
install:
|
install:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- npm ci
|
- cd server && npm install
|
||||||
|
|
||||||
lint:
|
deploy-main:
|
||||||
image: node:20
|
|
||||||
commands:
|
|
||||||
- npm run lint
|
|
||||||
depends_on: [install]
|
|
||||||
|
|
||||||
build:
|
|
||||||
image: node:20
|
|
||||||
commands:
|
|
||||||
- npm run build
|
|
||||||
depends_on: [install]
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
environment:
|
||||||
|
DEPLOY_KEY:
|
||||||
|
from_secret: deploy_key
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache openssh rsync
|
- apk add --no-cache openssh rsync
|
||||||
- rsync -e "ssh -i /ssh/deploy_key" -avz --delete dist/ root@192.168.1.88:/srv/shop/
|
- mkdir -p /ssh
|
||||||
- ssh -i /ssh/deploy_key root@192.168.1.88 'systemctl restart shop-server'
|
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
||||||
secrets: [deploy_key]
|
- chmod 600 /ssh/deploy_key
|
||||||
depends_on: [lint, build]
|
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete --exclude node_modules --exclude .env --exclude .dev_env --exclude uploads --exclude '*.db' ./server/ root@192.168.1.88:/opt/shop/server/server/
|
||||||
|
- ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no root@192.168.1.88 "cd /opt/shop/server/server && npm ci 2>&1 | tail -3 && npx prisma generate 2>&1 | tail -2 && npx prisma migrate deploy 2>&1 | tail -5 && systemctl restart shop-server"
|
||||||
|
depends_on: [install]
|
||||||
|
when:
|
||||||
|
branch: main
|
||||||
|
|
||||||
|
deploy-dev:
|
||||||
|
image: alpine:latest
|
||||||
|
environment:
|
||||||
|
DEPLOY_KEY:
|
||||||
|
from_secret: deploy_key
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache openssh rsync
|
||||||
|
- mkdir -p /ssh
|
||||||
|
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
||||||
|
- chmod 600 /ssh/deploy_key
|
||||||
|
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete --exclude node_modules --exclude .env --exclude .dev_env --exclude uploads --exclude '*.db' ./server/ root@192.168.1.118:/opt/shop/server/server/
|
||||||
|
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete --exclude .git --exclude node_modules ./shared/ root@192.168.1.118:/opt/shop/server/shared/
|
||||||
|
- ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no root@192.168.1.118 "cd /opt/shop/server/server && npm ci 2>&1 | tail -3 && npx prisma generate 2>&1 | tail -2 && npx prisma migrate deploy 2>&1 | tail -5 && systemctl restart shop-server"
|
||||||
|
depends_on: [install]
|
||||||
|
when:
|
||||||
|
branch: dev
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
trigger-1781703952
|
||||||
Reference in New Issue
Block a user