From de5e145c4e6c3a535597bc2cb02dcbb3a4e13f73 Mon Sep 17 00:00:00 2001 From: Fahri Can Date: Wed, 15 Apr 2026 17:02:30 +0300 Subject: [PATCH] refactor: simplify docker deployment without ssh acting as native socket executor --- .gitea/workflows/deploy.yml | 51 +++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 1af34ae..45bd093 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -2,38 +2,35 @@ name: Deploy Iddaai Frontend on: push: - branches: - - main + branches: [main] jobs: - deploy: + build-and-deploy: runs-on: ubuntu-latest - steps: - - name: Checkout Code + - name: Kodu Cek uses: actions/checkout@v4 - - name: Install sshpass - run: sudo apt-get update && sudo apt-get install -y sshpass - - - name: Deploy to Raspberry Pi via rsync - env: - SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }} - SERVER_IP: "95.70.252.214" - SERVER_PORT: "2222" - SERVER_USER: "haruncan" + - name: Docker Build run: | - export SSHPASS=$SERVER_PASSWORD - sshpass -e rsync -avz --exclude node_modules --exclude .git --exclude dist --exclude .next --exclude .DS_Store -e "ssh -o StrictHostKeyChecking=no -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_IP:~/apps/iddaai/fe/ + docker build \ + --build-arg NEXT_PUBLIC_API_URL='https://api.iddaai.com/api' \ + --build-arg NEXT_PUBLIC_AUTH_REQUIRED='false' \ + -t iddaai-fe:latest . - - name: Restart Frontend Docker Service - uses: appleboy/ssh-action@v1.0.3 - with: - host: "95.70.252.214" - port: "2222" - username: "haruncan" - password: ${{ secrets.SERVER_PASSWORD }} - script: | - cd ~/apps/iddaai - docker compose build frontend - docker compose up -d frontend + - name: Eski Konteyneri Sil + run: docker rm -f iddaai-fe || true + + - name: Yeni Versiyonu Baslat + run: | + docker run -d \ + --name iddaai-fe \ + --restart unless-stopped \ + --network iddaai_iddaai-network \ + -p 127.0.0.1:1510:3000 \ + -e NODE_ENV=production \ + -e NEXT_PUBLIC_API_URL='https://api.iddaai.com/api' \ + -e NEXTAUTH_URL='https://iddaai.com' \ + -e NEXTAUTH_SECRET='fFw34R134jRof1H2jofh2!32hU3gfjA1' \ + -e NEXT_PUBLIC_AUTH_REQUIRED='false' \ + iddaai-fe:latest