fix: rapidapi key
All checks were successful
Deploy QR Rapido / test (push) Successful in 1m6s
Deploy QR Rapido / build-and-push (push) Successful in 14m48s
Deploy QR Rapido / deploy-staging (push) Has been skipped
Deploy QR Rapido / deploy-production (push) Successful in 2m12s

This commit is contained in:
Ricardo Carneiro 2026-03-30 19:58:57 -03:00
parent 78bed0fbb1
commit 90cd5d7998
2 changed files with 18 additions and 1 deletions

View File

@ -180,9 +180,25 @@ jobs:
docker secret ls | grep -q "microsoft_client_id" || echo "AVISO: Secret microsoft_client_id não existe!"
docker secret ls | grep -q "microsoft_client_secret" || echo "AVISO: Secret microsoft_client_secret não existe!"
# Cria secret do RapidAPI automaticamente se não existir
echo "Gerenciando secret rapidapi_proxy_secret..."
if ! docker secret inspect rapidapi_proxy_secret > /dev/null 2>&1; then
printf '%s' '${{ secrets.RAPIDAPI_PROXY_SECRET }}' | docker secret create rapidapi_proxy_secret -
echo "Secret rapidapi_proxy_secret criado."
else
echo "Secret rapidapi_proxy_secret já existe."
fi
# Verifica se o service existe
if docker service inspect qrrapido-prod > /dev/null 2>&1; then
echo "Service existe, atualizando imagem..."
# Migração: adiciona o secret ao service se ainda não estiver configurado
if ! docker service inspect qrrapido-prod --format '{{range .Spec.TaskTemplate.ContainerSpec.Secrets}}{{.SecretName}} {{end}}' | grep -q "rapidapi_proxy_secret"; then
echo "Adicionando rapidapi_proxy_secret ao service existente..."
docker service update --secret-add rapidapi_proxy_secret --update-order start-first qrrapido-prod
fi
docker service update \
--image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
--env-add Serilog__OpenSearchUrl="http://141.148.162.114:19201" \
@ -208,6 +224,7 @@ jobs:
--secret google_client_secret \
--secret microsoft_client_id \
--secret microsoft_client_secret \
--secret rapidapi_proxy_secret \
--env ASPNETCORE_ENVIRONMENT=Production \
--env ASPNETCORE_URLS=http://+:8080 \
--env Serilog__OpenSearchUrl="http://141.148.162.114:19201" \

View File

@ -189,7 +189,7 @@
}
},
"RapidApi": {
"ProxySecret": ""
"ProxySecret": "c9a7c750-2c39-11f1-9fe6-59a87b6d6ae1"
},
"AllowedHosts": "*"
}