diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 1aeb9d0..e45cda3 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -93,14 +93,23 @@ jobs: chmod 600 ~/.ssh/key ssh-keyscan -H "${{ secrets.DEPLOY_HOST }}" >> ~/.ssh/known_hosts - # Write secrets to VPS (only if they've changed or first deploy) - ssh -i ~/.ssh/key "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ + echo "${{ secrets.FIREBASE_CREDENTIALS }}" | base64 -d > /tmp/firebase.json + + ssh -i ~/.ssh/key \ + "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ "mkdir -p ~/programs/etf-oglasi-server/config" + echo "${{ secrets.MAIL_CREDS }}" | base64 -d > /tmp/.creds - echo "${{ secrets.FIREBASE_CREDENTIALS }}" | \ - ssh -i ~/.ssh/key "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ - "cat > ~/programs/etf-oglasi-server/config/firebase.json" + scp -i ~/.ssh/key \ + /tmp/firebase.json \ + /tmp/.creds \ + "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:~/programs/etf-oglasi-server/config/" - ssh -i ~/.ssh/key "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ + + + rm /tmp/firebase.json + + ssh -i ~/.ssh/key \ + "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ "cd ~/programs/etf-oglasi-server && docker compose pull && docker compose up -d"