From 67ddaa4a2ca13d8b484ea30d0f2bd26b3be4b467 Mon Sep 17 00:00:00 2001 From: d3v1l0n Date: Sun, 29 Dec 2024 06:10:09 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=AC=20test:=20cpanel=20deployment=20ev?= =?UTF-8?q?ery=20month?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-cpanel.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/deploy-cpanel.yml diff --git a/.github/workflows/deploy-cpanel.yml b/.github/workflows/deploy-cpanel.yml new file mode 100644 index 00000000..9c0efbd8 --- /dev/null +++ b/.github/workflows/deploy-cpanel.yml @@ -0,0 +1,33 @@ +name: Deploy React to cPanel via FTP + +on: + schedule: + # Runs at midnight UTC on the 1st day of every month + - cron: '0 0 1 * *' + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + + - name: Install Dependencies + run: npm install + + - name: Build React App + run: npm run build + + - name: Deploy to cPanel via FTP + run: | + curl -s ftp://$FTP_SERVER --user $FTP_USER:$FTP_PASSWORD --upload-file ./dist/* --ftp-create-dirs + env: + FTP_SERVER: ${{ secrets.FTP_SERVER }} + FTP_USER: ${{ secrets.FTP_USER }} + FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}