diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeef44a..14d7c22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,28 @@ stages: - - build and deploy + - build + - deploy -build and deploy: - stage: build and deploy - only: - - main +build: + stage: build image: node:latest - before_script: - - apt-get update -qq && apt-get install -y rsync sshpass script: - npm install - 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 \ - -e "ssh -o StrictHostKeyChecking=no" \ + -e "ssh -p 2244 -o StrictHostKeyChecking=no" \ dist/ $USERNAME@$HOST:$PROD_PATH + dependencies: + - build