Merge pull request #71 from khoshov/feature/update-ui #17
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: 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: 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 }}" | |
| overwrite: true |