fix ci
This commit is contained in:
parent
6340eb37d1
commit
c0c5da472f
1 changed files with 8 additions and 13 deletions
|
|
@ -10,21 +10,16 @@ before_script:
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- push
|
|
||||||
|
|
||||||
build:
|
build_and_push:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- echo "DATABASE_URL=$DATABASE_URL" > .env
|
- echo "DATABASE_URL=$DATABASE_URL" > .env
|
||||||
- docker build -t "$IMAGE_NAME:$IMAGE_TAG" .
|
- docker build -t "$IMAGE_NAME:$IMAGE_TAG" .
|
||||||
|
- |
|
||||||
push:
|
if [ "$CI_COMMIT_REF_NAME" = "main" ]; then
|
||||||
stage: push
|
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:latest"
|
||||||
needs:
|
docker push "$IMAGE_NAME:latest"
|
||||||
- build
|
else
|
||||||
script:
|
echo "skipping push"
|
||||||
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:latest"
|
fi
|
||||||
- docker push "$IMAGE_NAME:latest"
|
|
||||||
only:
|
|
||||||
- main
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue