Skip to content

Commit

Permalink
workflows: try new library for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham-Lal committed Dec 20, 2023
1 parent d7d7afd commit 6269b8f
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,40 @@ name: Deploy to cPanel

on:
push:
branches:
- main
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies and build
run: |
cd client
npm install
npm run build
- name: Deploy to cPanel
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./client/dist/
server-dir: /github.shubhamlal.in/
exclude: |
**/.git
**/.git*/**
**/node_modules/**
**/.**
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies and build
run: |
cd client
npm install
npm run build
- name: Install lftp
run: sudo apt install lftp

- name: Configure lftp
run: |
mkdir ~/.lftp
echo "set ssl:verify-certificate false;" >> ~/.lftp/rc
- name: Load Secrets
run: |
echo "machine ${{ secrets.FTP_SERVER }} login ${{ secrets.FTP_USERNAME }} password ${{ secrets.FTP_PASSWORD }}" > ~/.netrc
- name: Upload dist folder
run: |
lftp -e "mirror --parallel=100 -R ./client/dist /github.shubhamlal.in/" ${{ secrets.FTP_SERVER }}

0 comments on commit 6269b8f

Please sign in to comment.