File: docs.yml

package info (click to toggle)
rust-rustls 0.23.36%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,460 kB
  • sloc: sh: 199; python: 181; makefile: 11
file content (96 lines) | stat: -rw-r--r-- 2,645 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: documentation

permissions:
  contents: read

on:
  workflow_dispatch:
  push:
    branches:
      - main
  schedule:
    - cron: '0 18 * * *'

jobs:
  generate:
    name: Generate pre-release documentation
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4
        with:
          persist-credentials: false

      - name: Install rust toolchain
        uses: dtolnay/rust-toolchain@nightly

      - name: Install zola
        uses: taiki-e/install-action@v2
        with:
          tool: zola@0.19.1

      - name: Generate version information
        run: |
          echo >tag.html \
            "<script>var version = document.querySelector(\"span.version\");" \
            "version.innerHTML += \"<br>(pre-release docs from <tt>$GITHUB_REF</tt>)\";" \
            "version.title = \"commit $GITHUB_SHA\";" \
            "</script>"

      - name: cargo doc
        # keep features in sync with Cargo.toml `[package.metadata.docs.rs]` section
        run: cargo doc --locked --features read_buf,ring --no-deps --package rustls
        env:
          RUSTDOCFLAGS: -Dwarnings --cfg=rustls_docsrs --html-after-content tag.html

      - name: Generate other pages
        run: |
          cd website && zola build --output-dir ../target/website/

      - name: Restore lychee cache
        uses: actions/cache@v4
        with:
          path: .lycheecache
          key: cache-lychee-${{ github.sha }}
          restore-keys: cache-lychee-

      - name: Check links
        uses: lycheeverse/lychee-action@v2
        with:
          args: >
            --accept 200..=204,403,429,500
            --cache
            --max-cache-age 1d
            --exclude-path 'website/content/'
            '**/*.md'
            'target/doc/**/*.html'
          fail: true

      - name: Massage rustdoc output
        run: |
          # lockfile causes deployment step to go wrong, due to permissions
          rm -f target/doc/.lock
          # move the result into website root
          mv target/doc/* target/website/
          mv target/website/rustls target/website/docs

      - name: Package and upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: ./target/website/

  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    if: github.repository == 'rustls/rustls'
    needs: generate
    permissions:
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4