From 9dda8a618b88d7bad6721632c40f4f72af34c281 Mon Sep 17 00:00:00 2001 From: Alina Hordiienko Date: Fri, 9 Aug 2024 12:59:59 +0400 Subject: [PATCH] deployment using github actions --- .github/workflows/deploy.yml | 27 +++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..079b43f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,27 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main # Trigger deployment when pushing to main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout the code + uses: actions/checkout@v3 + with: + lfs: true # Enable LFS + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Build and Deploy + run: npm run deploy \ No newline at end of file diff --git a/package.json b/package.json index 153d0b1..bd246dd 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ }, "scripts": { "start": "react-scripts --openssl-legacy-provider start", - "predeploy": "npm run build && git lfs install && git lfs track '*.csv' '*.geojson' && git add .gitattributes && git add build/ && git commit -m 'Preparing LFS files for deployment'", - "deploy": "gh-pages -d build", + "predeploy": "npm run build", + "deploy": "git lfs install && git lfs pull && gh-pages -d build", "build": "react-scripts --openssl-legacy-provider build", "test": "react-scripts --openssl-legacy-provider test", "eject": "react-scripts eject"