Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to GitHub pages on release only #2516

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading