|
| 1 | +name: Docs |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + schedule: |
| 11 | + - cron: "0 2 * * *" |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + name: Build website artifacts |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout uutils.github.io Repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + repository: uutils/uutils.github.io |
| 22 | + path: './uutils.github.io' |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - name: Checkout Coreutils Repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + repository: uutils/coreutils |
| 29 | + path: './coreutils' |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Checkout Findutils Repository |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + repository: uutils/findutils |
| 36 | + path: './findutils' |
| 37 | + fetch-depth: 0 |
| 38 | + |
| 39 | + - name: Install `rust` toolchain |
| 40 | + uses: dtolnay/rust-toolchain@stable |
| 41 | + |
| 42 | + - name: Install `libacl` |
| 43 | + run: | |
| 44 | + sudo apt install libacl1-dev |
| 45 | +
|
| 46 | + - name: Download tldr archive |
| 47 | + run: | |
| 48 | + curl https://tldr.sh/assets/tldr.zip --output coreutils/docs/tldr.zip |
| 49 | +
|
| 50 | + - name: Install necessary tools (mdbook and mdbook-toc) |
| 51 | + uses: taiki-e/install-action@v2 |
| 52 | + with: |
| 53 | + tool: mdbook,mdbook-toc |
| 54 | + |
| 55 | + - name: Build Coreutils Docs |
| 56 | + run: | |
| 57 | + cd coreutils |
| 58 | + cargo run --bin uudoc --all-features |
| 59 | + cd docs |
| 60 | + mdbook build |
| 61 | +
|
| 62 | + - name: Build Findutils Docs |
| 63 | + run: | |
| 64 | + cd findutils |
| 65 | + cd docs |
| 66 | + mdbook build |
| 67 | + |
| 68 | + - name: Run Zola |
| 69 | + uses: shalzz/zola-deploy-action@v0.18.0 |
| 70 | + env: |
| 71 | + BUILD_DIR: uutils.github.io |
| 72 | + BUILD_ONLY: true |
| 73 | + |
| 74 | + - name: Collect results into `public` folder |
| 75 | + run: | |
| 76 | + cp -r uutils.github.io/public public |
| 77 | + cp -r coreutils/docs/book public/coreutils/docs |
| 78 | + cp -r findutils/docs/book public/findutils/docs |
| 79 | +
|
| 80 | + - name: Upload artifact for checking the output |
| 81 | + uses: actions/upload-artifact@v4 |
| 82 | + with: |
| 83 | + path: ./public |
| 84 | + |
| 85 | + - name: Upload artifact for pages |
| 86 | + uses: actions/upload-pages-artifact@v3 |
| 87 | + with: |
| 88 | + path: ./public |
| 89 | + |
| 90 | + # dev-docs: |
| 91 | + # name: generate the dev doc |
| 92 | + # runs-on: ubuntu-latest |
| 93 | + # steps: |
| 94 | + # - name: Checkout repository |
| 95 | + # uses: actions/checkout@v4 |
| 96 | + # with: |
| 97 | + # repository: uutils/coreutils |
| 98 | + # path: './coreutils' |
| 99 | + # fetch-depth: 0 |
| 100 | + |
| 101 | + # - name: Install `rust` toolchain |
| 102 | + # uses: actions-rs/toolchain@v1 |
| 103 | + # with: |
| 104 | + # toolchain: stable |
| 105 | + # default: true |
| 106 | + # profile: minimal |
| 107 | + |
| 108 | + # - name: Build dev documentation |
| 109 | + # run: | |
| 110 | + # cd coreutils |
| 111 | + # cargo doc --no-deps --all-features --workspace |
| 112 | + |
| 113 | + # - name: Deploy Docs |
| 114 | + # uses: peaceiris/actions-gh-pages@v3 |
| 115 | + # with: |
| 116 | + # github_token: ${{ secrets.GITHUB_TOKEN }} |
| 117 | + # publish_dir: ./coreutils/target/doc |
| 118 | + # destination_dir: coreutils/dev/ |
| 119 | + |
| 120 | + # build-report: |
| 121 | + # name: generate the build report |
| 122 | + # runs-on: ubuntu-latest |
| 123 | + # steps: |
| 124 | + # - name: Checkout repository |
| 125 | + # uses: actions/checkout@v4 |
| 126 | + # with: |
| 127 | + # repository: uutils/coreutils |
| 128 | + # path: './coreutils' |
| 129 | + # fetch-depth: 0 |
| 130 | + |
| 131 | + # - name: Install `rust` toolchain |
| 132 | + # uses: actions-rs/toolchain@v1 |
| 133 | + # with: |
| 134 | + # toolchain: nightly |
| 135 | + # default: true |
| 136 | + # profile: minimal |
| 137 | + |
| 138 | + # - name: Build report |
| 139 | + # run: | |
| 140 | + # cd coreutils |
| 141 | + # cargo +nightly build --timings=html -Zunstable-options |
| 142 | + |
| 143 | + # - name: Deploy build report |
| 144 | + # uses: peaceiris/actions-gh-pages@v3 |
| 145 | + # with: |
| 146 | + # github_token: ${{ secrets.GITHUB_TOKEN }} |
| 147 | + # publish_dir: ./coreutils/target/cargo-timings/ |
| 148 | + # destination_dir: cargo-timings/ |
| 149 | + |
| 150 | + # Deployment job |
| 151 | + deploy: |
| 152 | + permissions: |
| 153 | + contents: read |
| 154 | + pages: write |
| 155 | + id-token: write |
| 156 | + environment: |
| 157 | + name: github-pages |
| 158 | + url: ${{ steps.deployment.outputs.page_url }} |
| 159 | + runs-on: ubuntu-latest |
| 160 | + needs: build |
| 161 | + steps: |
| 162 | + - name: Deploy to GitHub Pages |
| 163 | + id: deployment |
| 164 | + uses: actions/deploy-pages@v4 |
0 commit comments