Merge pull request #66 from khoshov/feature/update-ui #12
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: Copy files to server | |
| 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/" | |
| - 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!" |