fixed bug where grading editor could not open (#2888) #1023
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: Build sourceacademy.org | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
name: Build and deploy sourceacademy.org | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies (apt) | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y --no-install-recommends \ | |
libxi-dev libgl1-mesa-dev | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Setup Sentry CLI | |
run: | | |
curl -sL https://sentry.io/get-cli/ | INSTALL_DIR=. bash | |
- id: get-time | |
run: echo "time=$(date -Iseconds)" >> $GITHUB_OUTPUT | |
- name: yarn install and build | |
run: | | |
yarn install --frozen-lockfile | |
yarn run build | |
env: | |
REACT_APP_URL_SHORTENER_SIGNATURE: ${{ secrets.REACT_APP_URL_SHORTENER_SIGNATURE }} | |
REACT_APP_URL_SHORTENER_BASE: ${{ secrets.REACT_APP_URL_SHORTENER_BASE }} | |
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }} | |
REACT_APP_GOOGLE_CLIENT_ID: ${{ secrets.REACT_APP_GOOGLE_CLIENT_ID }} | |
REACT_APP_GOOGLE_API_KEY: ${{ secrets.REACT_APP_GOOGLE_API_KEY }} | |
REACT_APP_GOOGLE_APP_ID: ${{ secrets.REACT_APP_GOOGLE_APP_ID }} | |
REACT_APP_PLAYGROUND_ONLY: 'TRUE' | |
REACT_APP_VERSION: ${{ format('{0}-{1}', github.sha, steps.get-time.outputs.time) }} | |
REACT_APP_ENVIRONMENT: 'pages' | |
REACT_APP_MODULE_BACKEND_URL: https://source-academy.github.io/modules | |
REACT_APP_SHAREDB_BACKEND_URL: ${{ secrets.REACT_APP_SHAREDB_BACKEND_URL }} | |
PUBLIC_URL: 'https://sourceacademy.org' | |
REACT_APP_GITHUB_OAUTH_PROXY_URL: ${{ secrets.REACT_APP_GITHUB_OAUTH_PROXY_URL }} | |
REACT_APP_GITHUB_CLIENT_ID: ${{ secrets.REACT_APP_GITHUB_CLIENT_ID }} | |
- name: Create Sentry release | |
working-directory: build | |
run: | | |
SENTRY_RELEASE="cadet-frontend@$REACT_APP_VERSION" | |
"$GITHUB_WORKSPACE/sentry-cli" releases new -p "$SENTRY_PROJECT" "$SENTRY_RELEASE" | |
"$GITHUB_WORKSPACE/sentry-cli" releases set-commits --auto "$SENTRY_RELEASE" | |
"$GITHUB_WORKSPACE/sentry-cli" releases files "$SENTRY_RELEASE" upload-sourcemaps --url-prefix '~/static/js' --rewrite static/js | |
"$GITHUB_WORKSPACE/sentry-cli" releases finalize "$SENTRY_RELEASE" | |
"$GITHUB_WORKSPACE/sentry-cli" releases deploys "$SENTRY_RELEASE" new -e pages | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: sourceacademy | |
SENTRY_PROJECT: cadet-frontend | |
REACT_APP_VERSION: ${{ format('{0}-{1}', github.sha, steps.get-time.outputs.time) }} | |
- name: Remove sourcemaps | |
working-directory: build | |
run: | | |
find -name '*.map' -print -delete | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
external_repository: source-academy/sourceacademy.org | |
deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }} | |
publish_dir: ./build | |
publish_branch: master | |
force_orphan: true |