From 66318ec575fa01557ffa93d824856bc3663293df Mon Sep 17 00:00:00 2001 From: cupoftea4 Date: Mon, 14 Oct 2024 01:44:01 +0300 Subject: [PATCH] [ci/cd]: add Github actions --- .github/workflows/deploy-dev.yml | 34 ++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..78a9574 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,34 @@ +name: Deploy to FTP Server + +on: + push: + branches: + - develop + +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@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Deploy + uses: SamKirkland/FTP-Deploy-Action@4.3.1 + with: + server: '${{ secrets.FTP_SERVER }}' + username: '${{ secrets.DEV_FTP_USERNAME }}' + password: '${{ secrets.DEV_FTP_PASSWORD }}' + local-dir: ./build/ + server-dir: / \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1ac9a24 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy to FTP Server + +on: + push: + branches: + - master + +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@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Deploy + uses: SamKirkland/FTP-Deploy-Action@4.3.1 + with: + server: '${{ secrets.FTP_SERVER }}' + username: '${{ secrets.FTP_USERNAME }}' + password: '${{ secrets.FTP_PASSWORD }}' + local-dir: ./build/ + server-dir: / \ No newline at end of file