chore: update deployment workflow configuration #35
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 Flectone Web | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '24' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Deploy to server | |
| uses: easingthemes/ssh-deploy@main | |
| with: | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| ARGS: "-rlgoDzvc -i" | |
| SOURCE: "./" | |
| REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
| REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
| REMOTE_PORT: ${{ secrets.REMOTE_PORT }} | |
| TARGET: ${{ secrets.REMOTE_TARGET }} | |
| SCRIPT_BEFORE: | | |
| cd ${{ secrets.REMOTE_TARGET }} | |
| pm2 stop flectone-web 2>/dev/null || true | |
| rm -rf ${{ secrets.REMOTE_TARGET }}/* | |
| SCRIPT_AFTER: | | |
| cd ${{ secrets.REMOTE_TARGET }} | |
| npm ci --production | |
| pm2 start "npm start" --name "flectone-web" |