9 # Run at 18:00 UTC every day
14 runs-on: ubuntu-latest
17 MDBOOK_LINKCHECK_VERSION: 0.7.2
18 MDBOOK_TOC_VERSION: 0.6.1
20 BASE_SHA: ${{ github.event.pull_request.base.sha }}
22 - uses: actions/checkout@v2
24 # linkcheck needs the base commit.
27 - name: Cache binaries
29 uses: actions/cache@v2
33 key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}
35 - name: Cache linkcheck
36 uses: actions/cache@v2
40 key: ${{ runner.os }}-${{ hashFiles('./book/linkcheck') }}
42 - name: Check line lengths
43 if: github.event_name != 'push'
46 MAX_LINE_LENGTH=100 bash ci/check_line_lengths.sh src/**/*.md
48 - name: Install latest nightly Rust toolchain
49 if: steps.mdbook-cache.outputs.cache-hit != 'true'
50 uses: actions-rs/toolchain@v1
55 - name: Install Dependencies
56 if: steps.mdbook-cache.outputs.cache-hit != 'true'
58 cargo install mdbook --version ${{ env.MDBOOK_VERSION }}
59 cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }}
60 cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }}
65 - name: Deploy to gh-pages
66 if: github.event_name == 'push' && github.repository == 'rust-lang/rustc-dev-guide'
68 touch "${{ env.DEPLOY_DIR }}/.nojekyll"
69 cp CNAME "${{ env.DEPLOY_DIR }}"
70 cd "${{ env.DEPLOY_DIR }}"
73 git config user.name "Deploy from CI"
74 git config user.email ""
76 git commit -m "Deploy ${GITHUB_SHA} to gh-pages"
77 git push --quiet -f "https://x-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}" HEAD:gh-pages