Skip to content

Commit

Permalink
Publish docs to GitHub pages on release only (#2516)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Dec 10, 2024
1 parent 523801a commit c62485d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ defaults:
run:
shell: bash

env:
RUSTFLAGS: --deny warnings

jobs:
lint:
runs-on: ubuntu-latest

env:
RUSTFLAGS: --deny warnings

steps:
- uses: actions/checkout@v4

Expand All @@ -43,11 +43,6 @@ jobs:

pages:
runs-on: ubuntu-latest
permissions:
contents: write

env:
RUSTFLAGS: --deny warnings

steps:
- uses: actions/checkout@v4
Expand All @@ -72,14 +67,6 @@ jobs:
mdbook build book/en
mdbook build book/zh
- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master'
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_branch: gh-pages
publish_dir: www

test:
strategy:
matrix:
Expand All @@ -90,9 +77,6 @@ jobs:

runs-on: ${{matrix.os}}

env:
RUSTFLAGS: --deny warnings

steps:
- uses: actions/checkout@v4

Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ defaults:
run:
shell: bash

env:
RUSTFLAGS: --deny warnings

jobs:
prerelease:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -164,3 +167,43 @@ jobs:
prerelease: ${{ needs.prerelease.outputs.value }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pages:
runs-on: ubuntu-latest

needs:
- prerelease

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

- name: Install `mdbook`
run: cargo install mdbook

- name: Install `mdbook-linkcheck`
run: |
mkdir -p mdbook-linkcheck
cd mdbook-linkcheck
wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
chmod +x mdbook-linkcheck
pwd >> $GITHUB_PATH
- name: Build book
run: |
cargo run --package generate-book
mdbook build book/en
mdbook build book/zh
- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ needs.prerelease.outputs.value }}
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_branch: gh-pages
publish_dir: www
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@

`just` is a handy way to save and run project-specific commands.

This readme is also available as a [book](https://just.systems/man/en/).
This readme is also available as a [book](https://just.systems/man/en/). The
book reflects the latest release, whereas the
[readme on GitHub](https://github.com/casey/just/blob/master/README.md)
reflects latest master.

(中文文档在 [这里](https://github.com/casey/just/blob/master/README.中文.md),
快看过来!)
Expand Down

0 comments on commit c62485d

Please sign in to comment.