name: Deploy to Home Server on: push: branches: - main env: DEPLOY_PATH: /home/bini/project/collect-japan-news jobs: deploy: runs-on: ubuntu-latest steps: - name: Pull latest code run: | cd ${{ env.DEPLOY_PATH }} git pull origin main - name: Rebuild and restart container run: | cd ${{ env.DEPLOY_PATH }} docker compose down docker compose build --no-cache docker compose up -d - name: Cleanup old images run: docker image prune -f - name: Health check run: | sleep 5 curl -f http://localhost:8001 || exit 1