diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 1137aa9..f110208 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -197,6 +197,11 @@ jobs: ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no "${DEPLOY_USER}@${DEPLOY_HOST}" " set -e + # Configure insecure registry if not already configured + if ! grep -q '${REGISTRY_HOST}' /etc/docker/daemon.json 2>/dev/null; then + echo '{\"insecure-registries\": [\"${REGISTRY_HOST}\"]}' | sudo tee /etc/docker/daemon.json + sudo systemctl restart docker + fi cd /opt/mostovik-backend echo '${REGISTRY_PASSWORD}' | docker login --username '${REGISTRY_USER}' --password-stdin ${REGISTRY_HOST} export IMAGE_TAG=${BRANCH_TAG} @@ -246,6 +251,11 @@ jobs: ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no "${DEPLOY_USER}@${DEPLOY_HOST}" " set -e + # Configure insecure registry if not already configured + if ! grep -q '${REGISTRY_HOST}' /etc/docker/daemon.json 2>/dev/null; then + echo '{\"insecure-registries\": [\"${REGISTRY_HOST}\"]}' | sudo tee /etc/docker/daemon.json + sudo systemctl restart docker + fi cd /opt/mostovik-backend echo '${REGISTRY_PASSWORD}' | docker login --username '${REGISTRY_USER}' --password-stdin ${REGISTRY_HOST} export IMAGE_TAG=${BRANCH_TAG}