.gitlab-ci.yml 633 B

1234567891011121314151617181920212223242526272829303132
  1. stages:
  2. - build
  3. # - deploy
  4. # build stage
  5. build_app:
  6. image: node:alpine
  7. stage: build
  8. only:
  9. - main
  10. script:
  11. - npm install
  12. - npm run build:prod
  13. cache:
  14. paths:
  15. - node_modules/
  16. artifacts:
  17. paths:
  18. # build folder
  19. - dist/
  20. # expire_in: 1 hour
  21. #
  22. ## production stage
  23. #production:
  24. # stage: deploy
  25. # before_script:
  26. # - mkdir -p ~/.ssh
  27. # - echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
  28. # - chmod 600 ~/.ssh/id_rsa
  29. # - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  30. # script:
  31. # - scp -r dist/* username@server-ip-address:/var/www/html/