# Don't re-download node_modules every time. Cache it
cache:
  paths:
    - node_modules/

validate:
  image: gramener/builderrors
  # All templates are identical. noto, fximages, etc. have duplicate SVGs. Skip these issues
  script: builderrors --skip=duplicate-files

deploy:
  stage: deploy
  only: [v1, release]
  script:
    - 'ssh ubuntu@gramener.com "
      cd /mnt/gramener/apps/comicgenv1;
      git checkout -- .;
      git pull;
      npm install;
      npm run build;
      sudo systemctl restart comicgenv1;
      "'
  environment:
    name: production
    url: https://gramener.com/comicgen/v1/
