mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 17:26:45 +00:00
Updated CI/CD to use cache
This commit is contained in:
parent
d831bd65e0
commit
ab5a032269
@ -8,7 +8,10 @@ docker-build-main:
|
|||||||
before_script:
|
before_script:
|
||||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker build --pull -t "$CI_REGISTRY_IMAGE:develop" .
|
- docker pull "$CI_REGISTRY_IMAGE:develop-depsonly" || true
|
||||||
|
- docker build --cache-from "$CI_REGISTRY_IMAGE:develop-depsonly" --target build -t "$CI_REGISTRY_IMAGE:develop-depsonly" .
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:develop-depsonly"
|
||||||
|
- docker build -t "$CI_REGISTRY_IMAGE:develop" .
|
||||||
- docker push "$CI_REGISTRY_IMAGE:develop"
|
- docker push "$CI_REGISTRY_IMAGE:develop"
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH != "main"
|
- if: $CI_COMMIT_BRANCH != "main"
|
||||||
@ -25,8 +28,12 @@ docker-build-tag:
|
|||||||
before_script:
|
before_script:
|
||||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -t "$CI_REGISTRY_IMAGE" .
|
- docker pull "$CI_REGISTRY_IMAGE:develop-depsonly" || true
|
||||||
- docker push --all-tags "$CI_REGISTRY_IMAGE"
|
- docker build --cache-from "$CI_REGISTRY_IMAGE:develop-depsonly" -t "$CI_REGISTRY_IMAGE:develop-depsonly"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:develop-depsonly"
|
||||||
|
- docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -t "$CI_REGISTRY_IMAGE" .
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:latest"
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH != "main"
|
- if: $CI_COMMIT_BRANCH != "main"
|
||||||
when: never
|
when: never
|
||||||
|
Loading…
Reference in New Issue
Block a user