[Chore] reorganize the project by decoupling the kepler repo #137
This file contains 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 Next.js site to Pages | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
pull-requests: write | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
with: | |
static_site_generator: next | |
- name: Restore cache | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
/home/runner/work/reactgeoda/csds_kepler | |
key: ${{ runner.os }}-csds_kepler-${{ hashFiles('deps.txt') }} | |
- name: Install dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: | | |
npm install -g npm | |
npm install -g yarn | |
npm install -g node-gyp | |
cd .. | |
pwd | |
git clone https://github.com/GeoDaCenter/kepler.gl.git --branch=xli/reactgeoda csds_kepler | |
cd csds_kepler | |
yarn | |
- name: Run Lint | |
run: | | |
cd geoda-ai | |
yarn | |
yarn lint | |
- name: Build geoda-ai | |
run: | | |
touch .env | |
echo NEXT_PUBLIC_MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} >> geoda-ai/.env | |
echo NEXT_PUBLIC_API_KEY=${{ secrets.CHATGPT_TOKEN }} >> geoda-ai/.env | |
[[ "${{ github.event_name }}" = pull_request ]] && export BASE_PATH=/reactgeoda/pr-preview/pr-${{ github.event.number }} | |
cd geoda-ai | |
export NODE_ENV=production | |
export BASE_PATH=/reactgeoda/pr-preview/pr-${{ github.event.number }} | |
echo ${{github.event.pull_request.merged}} | |
if [[ ${{github.event.pull_request.merged}} == true ]]; then | |
export BASE_PATH=/reactgeoda | |
fi | |
NODE_ENV=production BASE_PATH=$BASE_PATH yarn build | |
# - name: Build Library | |
# run: | | |
# cd library | |
# export NODE_OPTIONS=--openssl-legacy-provider | |
# yarn | |
# yarn build |