From 046887c98d113704b12c9585ce94c4a047c00782 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 25 Aug 2023 17:27:47 +0100 Subject: [PATCH] move site to book.premai.io/state-of-open-source-ai --- .github/workflows/pages.yml | 12 +++++++++--- .redirect-template.html | 11 +++++++++++ CNAME | 1 + README.md | 4 ++-- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 .redirect-template.html create mode 100644 CNAME diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3329caa..ae72109 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -9,6 +9,8 @@ permissions: pages: write id-token: write concurrency: {group: "${{ github.ref }}-pages", cancel-in-progress: true} +env: + SITE_PREFIX: state-of-open-source-ai jobs: build: runs-on: ubuntu-latest @@ -21,7 +23,7 @@ jobs: - run: pip install -r requirements.txt - name: jupyter-book build run: | - sed -ri 's#^(\s*baseurl:).*#\1 ${{ steps.pages.outputs.base_url }}#g' _config.yml + sed -ri 's#^(\s*baseurl:).*#\1 ${{ steps.pages.outputs.base_url }}/'$SITE_PREFIX'#g' _config.yml # https://jupyterbook.org/en/stable/reference/cli.html jupyter-book build --builder linkcheck --warningiserror --nitpick --keep-going . jupyter-book build --builder dirhtml --warningiserror --nitpick --keep-going . @@ -32,9 +34,13 @@ jobs: root_file: book.tex args: -pdf -dvi- -ps- -file-line-error -f -interaction=nonstopmode continue-on-error: true - - run: cp _build/latex/book.pdf _build/dirhtml/ + - name: prepare _site pages + run: | + mkdir _site + mv _build/dirhtml _site/$SITE_PREFIX + mv _build/latex/book.pdf _site/$SITE_PREFIX/ + sed "s#DESTINATION#${{ steps.pages.outputs.base_url }}/$SITE_PREFIX#g" .redirect-template.html > _site/index.html - uses: actions/upload-pages-artifact@v2 - with: {path: _build/dirhtml} deploy: if: github.ref == 'refs/heads/main' environment: diff --git a/.redirect-template.html b/.redirect-template.html new file mode 100644 index 0000000..980eb5a --- /dev/null +++ b/.redirect-template.html @@ -0,0 +1,11 @@ + + + + Redirecting… + + + + +

Redirecting…

+ Click here if you are not redirected. + diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..cb1b6a2 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +book.premai.io \ No newline at end of file diff --git a/README.md b/README.md index 2b10a8c..2526e28 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ *Clarity in the current fast-paced mess of Open Source innovation.* -- Book: https://premAI-io.github.io/state-of-open-source-ai - + [Contributing Guide](https://premAI-io.github.io/state-of-open-source-ai/#contributing) +- Book: https://book.premai.io/state-of-open-source-ai + + [Contributing Guide](https://book.premai.io/state-of-open-source-ai/#contributing) - Community + [Discord](https://discord.com/invite/kpKk6vYVAn) + [Twitter](https://twitter.com/premai_io)