CI : split jobs and add port
This commit is contained in:
parent
59ed5bdb93
commit
36623a8072
1 changed files with 19 additions and 8 deletions
|
|
@ -1,17 +1,28 @@
|
||||||
stages:
|
stages:
|
||||||
- build and deploy
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
build and deploy:
|
build:
|
||||||
stage: build and deploy
|
stage: build
|
||||||
only:
|
|
||||||
- main
|
|
||||||
image: node:latest
|
image: node:latest
|
||||||
before_script:
|
|
||||||
- apt-get update -qq && apt-get install -y rsync sshpass
|
|
||||||
script:
|
script:
|
||||||
- npm install
|
- npm install
|
||||||
- npm run build
|
- npm run build
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- dist/
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
stage: deploy
|
||||||
|
image: node:latest
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq && apt-get install -y rsync sshpass
|
||||||
|
script:
|
||||||
- |
|
- |
|
||||||
sshpass -p "$PASSWORD" rsync -avz --delete \
|
sshpass -p "$PASSWORD" rsync -avz --delete \
|
||||||
-e "ssh -o StrictHostKeyChecking=no" \
|
-e "ssh -p 2244 -o StrictHostKeyChecking=no" \
|
||||||
dist/ $USERNAME@$HOST:$PROD_PATH
|
dist/ $USERNAME@$HOST:$PROD_PATH
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue