variables: NPMPATH: "node_modules/.bin" stages: - build - cleanup_build - deploy - cleanup build_job: stage: build script: - npm install - $NPMPATH/bower install - $NPMPATH/grunt tags: except: - tags artifacts: paths: - dist/ - info/ - resources/ - index.html - manifest.appcache cleanup_build_job: stage: cleanup_build script: - rm -r node_modules - rm -r bower_components - rm -r dist when: on_failure staging: stage: deploy script: deploy.sh environment: staging only: - develop variables: ENVIRON: staging production: stage: deploy script: deploy.sh environment: production only: - master variables: ENVIRON: production cleanup_job: stage: cleanup script: - rm -r node_modules - rm -r bower_components when: always