Skip to content

[Chore] Switch to openassistant #586

[Chore] Switch to openassistant

[Chore] Switch to openassistant #586

Workflow file for this run

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'
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Restore cache
id: cache-dependencies
uses: actions/cache@v3
with:
path: |
/home/runner/work/reactgeoda/csds_kepler
/home/runner/work/reactgeoda/loaders.gl
key: ${{ runner.os }}-csds_kepler-${{ hashFiles('deps.txt') }}
- name: Install Kepler.gl
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
cd ..
- name: Install GeoDa-Lib
run: |
cd ..
git clone https://github.com/GeoDaCenter/geoda-lib.git geoda-lib
- name: Install loaders.gl
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/visgl/loaders.gl.git --branch=xli/geoarrow-fix-in-mem-table loaders.gl
cd loaders.gl
PUPPETEER_SKIP_DOWNLOAD=true yarn
cd ..
- name: Run Lint and Test
run: |
cd geoda-ai
yarn
yarn lint
# - name: Create Sentry Release
# uses: getsentry/action-release@v1
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Get Head Commit Message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> $GITHUB_ENV
- name: Build geoda-ai with Sentry
id: build-with-sentry
if: ${{ contains(env.HEAD_COMMIT_MESSAGE, '[Sentry]') || github.ref == 'refs/heads/main' }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
NEXT_PUBLIC_MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
NODE_OPTIONS: '--max_old_space_size=4096'
run: |
cd geoda-ai
yarn build-local-with-sentry
- name: Build geoda-ai without Sentry
id: build-without-sentry
if: ${{ !contains(env.HEAD_COMMIT_MESSAGE, '[Sentry]') && github.ref != 'refs/heads/main' }}
run: |
cd geoda-ai
yarn build-local
- name: Deploy Preview to Netlify
id: deploy
# deploy when push to main or when commit message contains [Preview]
if: contains(env.HEAD_COMMIT_MESSAGE, '[Preview]')
uses: mathiasvr/[email protected]
with:
run: |
cd geoda-ai
netlify deploy --dir=out --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --alias draft-${{ github.event.number }} | grep -o 'https://[^ ]*'
- name: Comment PR
if: contains(env.HEAD_COMMIT_MESSAGE, '[Preview]')
uses: thollander/actions-comment-pull-request@v2
with:
message: |
:rocket: Deploy preview available at: ${{ steps.deploy.outputs.stdout }}
- name: Deploy Production to Netlify
if: github.ref == 'refs/heads/main'
run: |
cd geoda-ai
netlify deploy --prod --dir=out --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }}
# - name: Build Library
# run: |
# cd library
# export NODE_OPTIONS=--openssl-legacy-provider
# yarn
# yarn build