Skip to content

Deploy Clippy book through CI/CD #8959

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 4 additions & 1 deletion .github/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex

echo "Removing the current docs for master"
rm -rf out/master/ || exit 0
rm -rf out/master/ out/book/ || exit 0

echo "Making the docs for master"
mkdir out/master/
Expand All @@ -29,6 +29,9 @@ cp util/gh-pages/versions.html out/index.html
echo "Making the versions.json file"
python3 ./util/versions.py out

# Copying the book
mv book/book out

# Now let's go have some fun with the cloned repo
cd out
git config user.name "GHA CI"
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
ref: ${{ env.TARGET_BRANCH }}
path: 'out'

- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.18/mdbook-v0.4.18-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH

# Run
- name: Set tag name
if: startswith(github.ref, 'refs/tags/')
Expand Down Expand Up @@ -57,6 +63,9 @@ jobs:
- name: cargo collect-metadata
run: cargo collect-metadata

- name: Build book
run: mdbook build book

- name: Deploy
run: |
eval "$(ssh-agent -s)"
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ All contributors are expected to follow the [Rust Code of Conduct].
If you're new to Clippy and don't know where to start the [Clippy book] includes
a developer guide and is a good place to start your journey.

<!-- FIXME: Link to the deployed book, once it is deployed through CI -->
[Clippy book]: book/src
[Clippy book]: https://rust-lang.github.io/rust-clippy/book/index.html

## High level approach

Expand Down
2 changes: 1 addition & 1 deletion util/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main():

outdir = sys.argv[1]
versions = [
dir for dir in os.listdir(outdir) if not dir.startswith(".") and os.path.isdir(os.path.join(outdir, dir))
dir for dir in os.listdir(outdir) if not dir.startswith(".") and dir != "book" and os.path.isdir(os.path.join(outdir, dir))
]
versions.sort(key=key)

Expand Down