.gitlab-ci.yml 1003 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. stages:
  2. - compile
  3. - build
  4. # Workaround for ipv6 issues
  5. default:
  6. before_script:
  7. - alias npm="node --dns-result-order=ipv4first $(which npm)"
  8. compile:
  9. stage: compile
  10. image: node:lts-alpine
  11. script:
  12. - npm ci
  13. - npm run webpack
  14. artifacts:
  15. paths:
  16. - dist/
  17. expire_in: 1h
  18. build-docker-image:
  19. stage: build
  20. variables:
  21. COMPONENT_NAME: demonstrator
  22. VERSION_TAG: latest
  23. image:
  24. name: gcr.io/kaniko-project/executor:debug
  25. entrypoint: [""]
  26. rules:
  27. - if: '$CI_COMMIT_BRANCH == "master"'
  28. when: always
  29. dependencies:
  30. - compile
  31. script:
  32. - mkdir -p /kaniko/.docker
  33. - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
  34. - >-
  35. /kaniko/executor
  36. --context "${CI_PROJECT_DIR}"
  37. --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
  38. --destination "${CI_REGISTRY_IMAGE}/${COMPONENT_NAME}:${VERSION_TAG}"