Merge pull request #21 from Healy-Hyperspatial/add-tests #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy React to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./sfeos-web # ← ADD THIS | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: ./sfeos-web/package-lock.json # ← Optional but helps | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test -- --watchAll=false | |
| - name: Build | |
| run: npm run build | |
| env: | |
| REACT_APP_MAPTILER_KEY: ${{ secrets.MAPTILER_KEY }} | |
| REACT_APP_STAC_API_URL: https://stac.dataspace.copernicus.eu/v1 | |
| - name: Fix SPA routing | |
| run: cp build/index.html build/404.html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./sfeos-web/build # ← Point to subfolder | |
| - name: Deploy | |
| uses: actions/deploy-pages@v4 |