From c32eaff29f09b3d744d2269ce2b72a88d5dd5f40 Mon Sep 17 00:00:00 2001 From: Samuel Fang Date: Wed, 16 Jun 2021 14:50:59 +0800 Subject: [PATCH] Fix 404 bug for SICP-JS pages (#1794) * Add symbolic links from sicp pages to index * Add newline to eof --- .github/workflows/build-development.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-development.yml b/.github/workflows/build-development.yml index b66cc76cf2..482b8b146c 100644 --- a/.github/workflows/build-development.yml +++ b/.github/workflows/build-development.yml @@ -37,12 +37,6 @@ jobs: run: | yarn install yarn run build - ln -s index.html build/playground.html - ln -s index.html build/contributors.html - ln -s index.html build/sourcecast.html - ln -s index.html build/interactive-sicp.html - # the `ln`s above are a hack to make GitHub Pages route /playground - # and /contributors etc to index, instead of 404-ing. env: REACT_APP_URL_SHORTENER_SIGNATURE: ${{ secrets.REACT_APP_URL_SHORTENER_SIGNATURE }} REACT_APP_URL_SHORTENER_DOMAIN: ${{ secrets.REACT_APP_URL_SHORTENER_DOMAIN }} @@ -60,7 +54,20 @@ jobs: PUBLIC_URL: "https://source-academy.github.io" 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 symbolic links + run: | + set -euxo pipefail + ln -s index.html build/playground.html + ln -s index.html build/contributors.html + ln -s index.html build/sourcecast.html + ln -s index.html build/interactive-sicp.html + mkdir -p build/interactive-sicp + declare -a arr=("index" "foreword" "prefaces03" "prefaces84" "prefaces96" "acknowledgements" "1" "1.1" "1.1.1" "1.1.2" "1.1.3" "1.1.4" "1.1.5" "1.1.6" "1.1.7" "1.1.8" "1.2" "1.2.1" "1.2.2" "1.2.3" "1.2.4" "1.2.5" "1.2.6" "1.3" "1.3.1" "1.3.2" "1.3.3" "1.3.4" "2" "2.1" "2.1.1" "2.1.2" "2.1.3" "2.1.4" "2.2" "2.2.1" "2.2.2" "2.2.3" "2.2.4" "2.3" "2.3.1" "2.3.2" "2.3.3" "2.3.4" "2.4" "2.4.1" "2.4.2" "2.4.3" "2.5" "2.5.1" "2.5.2" "2.5.3" "3" "3.1" "3.1.1" "3.1.2" "3.1.3" "3.2" "3.2.1" "3.2.2" "3.2.3" "3.2.4" "3.3" "3.3.1" "3.3.2" "3.3.3" "3.3.4" "3.3.5" "3.4" "3.4.1" "3.4.2" "3.5" "3.5.1" "3.5.2" "3.5.3" "3.5.4" "3.5.5" "4" "4.1" "4.1.1" "4.1.2" "4.1.3" "4.1.4" "4.1.5" "4.1.6" "4.1.7" "4.2" "4.2.1" "4.2.2" "4.2.3" "4.3" "4.3.1" "4.3.2" "4.3.3" "4.4" "4.4.1" "4.4.2" "4.4.3" "4.4.4" "5" "5.1" "5.1.1" "5.1.2" "5.1.3" "5.1.4" "5.1.5" "5.2" "5.2.1" "5.2.2" "5.2.3" "5.2.4" "5.3" "5.3.1" "5.3.2" "5.4" "5.4.1" "5.4.2" "5.4.3" "5.4.4" "5.5" "5.5.1" "5.5.2" "5.5.3" "5.5.4" "5.5.5" "5.5.6" "5.5.7" "references" "making-of") + for i in "${arr[@]}"; do + ln -s ../index.html build/interactive-sicp/$i.html + done + # the `ln`s above are a hack to make GitHub Pages route /playground + # and /contributors etc to index, instead of 404-ing. - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: