diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e89cf51..6ea6177c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,14 +3,6 @@ stages: - deploy_tags - deploy -cache: - key: dependencies - paths: - - _build/ - - deps/ - - node_modules/ - - apps/app/assets/node_modules/ - variables: POSTGRES_PASSWORD: "postgres" POSTGRES_USER: "postgres" @@ -26,6 +18,13 @@ test: image: "elixir:1.10" services: - name: postgres:12 + cache: + key: + files: + - mix.lock + paths: + - _build/ + - deps/ script: script/cibuild build_image_for_commit: @@ -36,6 +35,15 @@ build_image_for_commit: - master services: - name: docker:19.03.12-dind + cache: + key: + files: + - mix.lock + - apps/app/assets/package-lock.json + paths: + - _build/ + - deps/ + - apps/app/assets/node_modules/ script: - docker login "https://${CI_REGISTRY}" -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD - docker pull $CI_REGISTRY_IMAGE:latest || true @@ -48,6 +56,12 @@ deploy_to_tags: image: "node:15.0" only: - master + cache: + key: + files: + - package-lock.json + paths: + - node_modules/ script: - npm install - npx semantic-release --repository-url=$CI_REPOSITORY_URL @@ -67,6 +81,8 @@ deploy_commit_image_to_tag: image: "docker:19.03.12" services: - name: docker:19.03.12-dind + variables: + GIT_STRATEGY: none # this job does not need the project files, only docker script: - echo "BUILD_VERSION is ${BUILD_VERSION}" - docker login "https://${CI_REGISTRY}" -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD