From 0f4cc6c46c54acafb9f36095bb0b1fb739710350 Mon Sep 17 00:00:00 2001 From: Zhu Siyuan <3200100491@zju.edu.cn> Date: Tue, 27 Feb 2024 15:51:45 +0800 Subject: [PATCH] [CI/CD] pages --- .github/workflows/deploy.yml | 15 +++++++++++++++ .gitlab-ci.yml | 19 +++++++++++++++++++ mkdocs.yml | 17 +++++++++++++---- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..965bd70 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,15 @@ +name: Deploy on GitHub Pages +on: + push: + branches: + - main +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: 3.x + - run: pip install mkdocs-material mkdocs-heti-plugin + - run: mkdocs gh-deploy --force diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2cdefaa --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +# The Docker image that will be used to build your app +image: python:3.8-bullseye +cache: # Pip's cache doesn't store the python packages + paths: # https://pip.pypa.io/en/stable/topics/caching/ + - .cache/pip +# Functions that should be executed before the build script is run +before_script: + - pip install mkdocs-material mkdocs-heti-plugin +pages: + script: + - mkdocs build --verbose --strict + artifacts: + paths: + # The folder that contains the files to be exposed at the Page URL + - public + rules: + # This ensures that only pushes to the default branch will trigger + # a pages deploy + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH diff --git a/mkdocs.yml b/mkdocs.yml index 52bbaae..3ce7f4f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ site_name: 浙江大学编译原理课程实验 -#site_url: https://floatshadow.github.io/compiler24/ +site_url: https://floatshadow.github.io/accipit/ repo_url: https://github.com/floatshaodw/accipit repo_name: floatshadow/accipit theme: @@ -20,22 +20,31 @@ theme: - media: "(prefers-color-scheme: light)" scheme: default toggle: - icon: material/toggle-switch-off-outline + icon: material/brightness-7 name: Switch to dark mode - media: "(prefers-color-scheme: dark)" scheme: slate toggle: - icon: material/toggle-switch + icon: material/brightness-4 name: Switch to light mode nav: - Accipit IR 规范: accipit-spec.md - SysY 语言规范: sysy-spec.md - +plugins: + - search + - heti: + extra_skipped_class: + - arithmatex extra_javascript: + - https://cdn.tonycrane.cc/utils/katex.min.js - javascripts/katex.js +extra_css: + - https://cdn.tonycrane.cc/utils/katex.min.css + - https://fonts.googleapis.com/css?family=Roboto:500,500i,600,600i&display=fallback + markdown_extensions: - toc: permalink: true