Skip to content

Instantly share code, notes, and snippets.

@nrchandan
Created August 8, 2020 17:46
Show Gist options
  • Save nrchandan/e009fd86dd27ef16b714ec118752d469 to your computer and use it in GitHub Desktop.
Save nrchandan/e009fd86dd27ef16b714ec118752d469 to your computer and use it in GitHub Desktop.
image: node:13.10
stage_job:
stage: deploy
only:
- develop
cache:
paths:
- node_modules
before_script:
- mkdir -p ~/.ssh
- echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- npm install
- ./node_modules/@angular/cli/bin/ng build --prod --base-href .
- ssh Administrator@$DEPLOY_SERVER "del /s /q \inetpub\wwwroot\my-awesome-project"
- scp -r dist/* Administrator@$DEPLOY_SERVER:/inetpub/wwwroot/my-awesome-project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment