feat: add dev pipeline with branch-specific deploy
This commit is contained in:
+6
-2
@@ -6,16 +6,19 @@ steps:
|
|||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm ci
|
- cd client && npm ci
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm run lint
|
- cd client && npm run lint
|
||||||
depends_on: [install]
|
depends_on: [install]
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm run build
|
- cd client && npm run build
|
||||||
depends_on: [install]
|
depends_on: [install]
|
||||||
|
|
||||||
deploy-main:
|
deploy-main:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
environment:
|
environment:
|
||||||
@@ -24,12 +27,13 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- apk add --no-cache openssh rsync
|
- apk add --no-cache openssh rsync
|
||||||
- mkdir -p /ssh
|
- mkdir -p /ssh
|
||||||
- echo "" > /ssh/deploy_key
|
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
||||||
- chmod 600 /ssh/deploy_key
|
- chmod 600 /ssh/deploy_key
|
||||||
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.88:/var/www/
|
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.88:/var/www/
|
||||||
depends_on: [lint, build]
|
depends_on: [lint, build]
|
||||||
when:
|
when:
|
||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
deploy-dev:
|
deploy-dev:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
environment:
|
environment:
|
||||||
@@ -38,7 +42,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- apk add --no-cache openssh rsync
|
- apk add --no-cache openssh rsync
|
||||||
- mkdir -p /ssh
|
- mkdir -p /ssh
|
||||||
- echo "" > /ssh/deploy_key
|
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
||||||
- chmod 600 /ssh/deploy_key
|
- chmod 600 /ssh/deploy_key
|
||||||
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.118:/var/www/
|
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.118:/var/www/
|
||||||
depends_on: [lint, build]
|
depends_on: [lint, build]
|
||||||
|
|||||||
Reference in New Issue
Block a user