Skip to content

Instantly share code, notes, and snippets.

@hcastillaq
Created January 24, 2020 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcastillaq/ceab93bf79af94e8e58e3845c91f090c to your computer and use it in GitHub Desktop.
Save hcastillaq/ceab93bf79af94e8e58e3845c91f090c to your computer and use it in GitHub Desktop.
ci gitlab basico
build:
image: node:latest
stage: build
script:
- rm package-lock.json
- npm install --progress=false
- npm run production --no-progress
artifacts:
expire_in: 10 mins
paths:
- public
only:
refs:
- ui
deploy:
image: alpine
stage: deploy
script:
- apk add --no-cache rsync openssh
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
- chmod 600 ~/.ssh/id_dsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- touch hola.txt
- echo $SSH_PORT
- rsync -rav -e "ssh -p $SSH_PORT" --progress --delete public/ $SSH_HOST:$PUBLIC_PATH
only:
refs:
- ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment