Compare commits

...

1 Commits

Author SHA1 Message Date
ea6297e5e2 feat: deploy to prod 2024-01-15 19:26:22 +03:00
2 changed files with 31 additions and 8 deletions

@ -11,28 +11,43 @@ stages:
- deploy
clear-old-images:
tags:
- frontbuild
extends: .clean_template
variables:
STAGING_BRANCH: "main"
STAGING_BRANCH: "without-buttons"
PRODUCTION_BRANCH: "main"
image:
name: docker/compose:1.28.0
entrypoint: [""]
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker images
script:
- docker system prune -af
build-app:
tags:
- frontbuild
extends: .build_template
variables:
DOCKER_BUILD_PATH: "./Dockerfile"
STAGING_BRANCH: "main"
PRODUCTION_BRANCH: "main"
BRANCH: "without-buttons"
rules:
- if: "$CI_COMMIT_BRANCH == $BRANCH"
when: on_success
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID --build-arg GITLAB_TOKEN=$GITLAB_TOKEN $CI_PROJECT_DIR
- docker push $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
deploy-to-staging:
tags:
- front
- prod
extends: .deploy_template
variables:
DEPLOY_TO: "staging"
BRANCH: "main"
BRANCH: "without-buttons"
rules:
- if: "$CI_COMMIT_BRANCH == $BRANCH"
script:
- docker login -u $REGISTRY_USER -p $REGISTRY_TOKEN $CI_REGISTRY
- docker-compose -f deployments/main/docker-compose.yaml up -d

@ -0,0 +1,8 @@
services:
squiz:
container_name: squiz
restart: unless-stopped
image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
hostname: squiz
tty: true