Merge pull request #69 from khoshov/feature/update-ui #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Dev. server | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install deps (frontend) | |
| working-directory: frontend | |
| run: npm ci | |
| - name: Debug TypeScript config and paths | |
| working-directory: frontend | |
| run: | | |
| npx tsc -p tsconfig.json --showConfig | sed -n '1,200p' | |
| ls -la src/lib || true | |
| grep -R --line-number --color=never "from '@/lib" src || true | |
| - name: Build frontend | |
| working-directory: frontend | |
| run: npm run build | |
| - name: Deploy | |
| uses: appleboy/ssh-action@v1.0.0 | |
| with: | |
| host: ${{ secrets.DEV_SERVER_HOST }} | |
| username: ${{ secrets.DEV_SSH_USERNAME }} | |
| key: ${{ secrets.DEV_SSH_PRIVATE_KEY }} | |
| script: | | |
| cd ${{ secrets.DEV_PROJECT_PATH }} | |
| git pull origin develop | |
| uv sync --no-dev | |
| uv run manage.py migrate | |
| sudo systemctl restart pythonbooks | |
| echo "Deployment successful!" | |
| - name: Prepare server (ensure tar & dir) | |
| uses: appleboy/ssh-action@v1.0.0 | |
| with: | |
| host: ${{ secrets.DEV_SERVER_HOST }} | |
| username: ${{ secrets.DEV_SSH_USERNAME }} | |
| key: ${{ secrets.DEV_SSH_PRIVATE_KEY }} | |
| script: | | |
| command -v tar >/dev/null 2>&1 || ( \ | |
| (command -v apt-get >/dev/null && sudo apt-get update && sudo apt-get install -y tar gzip) || \ | |
| (command -v yum >/dev/null && sudo yum install -y tar gzip) || \ | |
| (command -v apk >/dev/null && sudo apk add tar gzip) \ | |
| ) | |
| mkdir -p ${{ secrets.DEV_PROJECT_PATH }}/frontend/dist | |
| - name: Upload frontend dist | |
| uses: appleboy/scp-action@v0.1.7 | |
| with: | |
| host: ${{ secrets.DEV_SERVER_HOST }} | |
| username: ${{ secrets.DEV_SSH_USERNAME }} | |
| key: ${{ secrets.DEV_SSH_PRIVATE_KEY }} | |
| source: "frontend/dist/*" | |
| target: "${{ secrets.DEV_PROJECT_PATH }}/frontend/dist/" | |
| overwrite: true |