From 8e9fc6521dbeb7a9ffbade3bb95123bd82c643ac Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Mon, 17 Mar 2025 20:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgithubpages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pages.yml | 51 +++++++++++++++++++++++++++++++++++++ docs/Gemfile | 25 ++++++++++++++++++ docs/_config.yml | 2 +- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pages.yml create mode 100644 docs/Gemfile diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..0c29ecb0 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,51 @@ +name: Deploy Jekyll site to Pages + +on: + push: + branches: ["main"] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Build site + run: | + cd docs + bundle install + bundle exec jekyll build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_site + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 00000000..6a854952 --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,25 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 4.3.2" +gem "just-the-docs", "~> 0.5.0" + +group :jekyll_plugins do + gem "jekyll-include-cache" + gem "jekyll-paginate" + gem "jekyll-sitemap" + gem "jemoji" +end + +# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem +# and associated library. +platforms :mingw, :x64_mingw, :mswin, :jruby do + gem "tzinfo", ">= 1", "< 3" + gem "tzinfo-data" +end + +# Performance-booster for watching directories on Windows +gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem +# do not have a Java counterpart. +gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] \ No newline at end of file diff --git a/docs/_config.yml b/docs/_config.yml index 77558754..32a0b5b8 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,4 +1,4 @@ -theme: just-the-docs +remote_theme: just-the-docs/just-the-docs url: https://xerrors.github.io/Yuxi-Know baseurl: /Yuxi-Know title: 语析 - 基于大模型的知识库与知识图谱问答系统