index: update #150
This file contains hidden or 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
| # https://squidfunk.github.io/mkdocs-material/publishing-your-site/ | |
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| with: | |
| key: mkdocs-material-${{ env.cache_id }} | |
| path: .cache | |
| restore-keys: | | |
| mkdocs-material- | |
| - run: pip install -r requirements.txt | |
| - run: mkdocs build | |
| deploy: | |
| # only deploy on main repo | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ZJU-OS/doc' | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: enable git-committers | |
| run: | | |
| sed -i 's/enabled: false/enabled: true/' mkdocs.yml | |
| - name: Configure Git Credentials | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| with: | |
| key: mkdocs-material-${{ env.cache_id }} | |
| path: .cache | |
| restore-keys: | | |
| mkdocs-material- | |
| - run: pip install -r requirements.txt | |
| - name: Get latest RISC-V Spec HTML | |
| run: | | |
| mkdir -p docs/spec | |
| wget --quiet https://github.com/riscv/riscv-isa-manual/releases/latest/download/riscv-privileged.html -O docs/spec/riscv-privileged.html | |
| wget --quiet https://github.com/riscv/riscv-isa-manual/releases/latest/download/riscv-unprivileged.html -O docs/spec/riscv-unprivileged.html | |
| wget --quiet https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/latest/download/riscv-abi.pdf -O docs/spec/riscv-abi.pdf | |
| wget --quiet https://github.com/riscv-non-isa/riscv-sbi-doc/releases/latest/download/riscv-sbi.pdf -O docs/spec/riscv-sbi.pdf | |
| wget --quiet https://github.com/riscv-non-isa/riscv-asm-manual/releases/latest/download/riscv-asm.pdf -O docs/spec/riscv-asm.pdf | |
| - run: mkdocs gh-deploy --force --no-history |