build: split jobs to fix image tagging
This commit is contained in:
parent
229a0c8304
commit
c438a8b75b
|
@ -49,14 +49,15 @@ stages:
|
|||
- mkdir ${HOME}/.docker
|
||||
- echo "${DOCKER_SECRET}" | base64 -d > ${HOME}/.docker/config.json
|
||||
- docker info
|
||||
|
||||
script:
|
||||
- docker build -t $IMAGE_TAG .
|
||||
- docker push $IMAGE_TAG
|
||||
after_script:
|
||||
- rm -rfv ${HOME}/.docker
|
||||
|
||||
variables: &vars-docker
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_HOST: tcp://localhost:2375
|
||||
IMAGE_TAG: ssube/salty-dog:${CI_COMMIT_TAG:-${CI_COMMIT_REF_SLUG}}
|
||||
|
||||
.build-node: &build-node
|
||||
image: apextoaster/node:11.15
|
||||
|
@ -98,15 +99,29 @@ build-node:
|
|||
- node_modules
|
||||
- out/cache
|
||||
|
||||
build-image:
|
||||
build-image-branch:
|
||||
<<: [*build-docker]
|
||||
stage: image
|
||||
except:
|
||||
- tags
|
||||
|
||||
dependencies:
|
||||
- build-node
|
||||
script:
|
||||
- docker build -t $IMAGE_TAG .
|
||||
- docker push $IMAGE_TAG
|
||||
variables:
|
||||
<<: [*vars-docker]
|
||||
IMAGE_TAG: "ssube/salty-dog:${CI_COMMIT_REF_SLUG}"
|
||||
|
||||
build-image-tag:
|
||||
<<: [*build-docker]
|
||||
stage: image
|
||||
only:
|
||||
- tags
|
||||
|
||||
dependencies:
|
||||
- build-node
|
||||
variables:
|
||||
<<: [*vars-docker]
|
||||
IMAGE_TAG: "ssube/salty-dog:${CI_COMMIT_TAG}"
|
||||
|
||||
# publish jobs
|
||||
publish-npm:
|
||||
|
|
Loading…
Reference in New Issue