This commit is contained in:
tuanvu
2026-02-16 17:38:10 +01:00
parent 9d15c7dfa3
commit 181eb1ae4a

View File

@@ -87,8 +87,7 @@ deploy_production:
image: alpine:latest image: alpine:latest
dependencies: dependencies:
- build_docker_frontend - build_docker_frontend
rules: - check_app_update
- if: '$NEW_COMMIT == "true"'
before_script: before_script:
- apk add --no-cache openssh-client docker-cli - apk add --no-cache openssh-client docker-cli
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
@@ -97,13 +96,18 @@ deploy_production:
- chmod 600 ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H "$DEPLOY_SERVER" >> ~/.ssh/known_hosts 2>/dev/null || true - ssh-keyscan -H "$DEPLOY_SERVER" >> ~/.ssh/known_hosts 2>/dev/null || true
script: script:
- source variables.env || true
- if [ "$NEW_COMMIT" != "true" ]; then
echo "No new commit, skipping build";
exit 0;
fi
- | - |
ssh "$DEPLOY_USER@$DEPLOY_SERVER" << 'EOF' ssh "$DEPLOY_USER@$DEPLOY_SERVER" << 'EOF'
cd /app cd /app
docker compose pull docker compose pull
docker compose up -d docker compose up -d
EOF EOF
#environment: environment:
#name: production name: production
#url: http://127.0.0.1 url: http://148.60.11.130
when: manual when: manual