Skip to content

Fixed deploy pipeline #21

Fixed deploy pipeline

Fixed deploy pipeline #21

Workflow file for this run

name: Deploy to Server
on:
push:
branches:
- main
- deploy
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '21' # Set the Node.js version
- name: Build Project
run: |
cd ./client
npm install [email protected] --save-dev # Force TypeScript to a compatible version
npm install
npm run build
- name: Copy files to the server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
source: "client/build/*"
target: "/var/www/llcode.tech/html/"
strip_components: 2
- name: Reload Nginx
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: "nginx -s reload"