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"