|
1 | | -# Based on ripgrep's release action: |
2 | | -# https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml |
3 | | - |
4 | 1 | name: CI/CD for Documentation |
5 | | -on: [push, pull_request] |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
6 | 10 | permissions: |
7 | 11 | contents: write |
| 12 | + |
8 | 13 | jobs: |
9 | 14 | build-and-deploy: |
10 | | - name: build-and-deploy |
11 | | - runs-on: ubuntu-latest |
| 15 | + runs-on: ubuntu-24.04 |
12 | 16 | steps: |
13 | | - - uses: actions/checkout@v3 |
| 17 | + - uses: actions/checkout@v4 |
14 | 18 | - uses: dtolnay/rust-toolchain@master |
15 | 19 | with: |
16 | | - toolchain: '1.77' |
| 20 | + toolchain: "1.77" |
17 | 21 | - uses: Swatinem/rust-cache@v2 |
18 | 22 | - uses: jdx/mise-action@v2 |
19 | 23 | - run: uv sync --locked |
20 | 24 | - run: mise run generate-docs |
21 | 25 | - run: mise run generate-web |
22 | | - # deploy ./dist to https://github.com/typst-doc-cn/typst-doc-cn.github.io |
| 26 | + - name: Upload build artifacts |
| 27 | + uses: actions/upload-artifact@v4 |
| 28 | + with: |
| 29 | + name: build-artifacts |
| 30 | + path: dist |
23 | 31 | - name: Deploy |
24 | 32 | if: github.ref == 'refs/heads/main' |
25 | 33 | uses: JamesIves/github-pages-deploy-action@v4 |
26 | 34 | with: |
27 | 35 | folder: dist # The folder the action should deploy. |
| 36 | + |
| 37 | + textlint-md: |
| 38 | + runs-on: ubuntu-24.04 |
| 39 | + steps: |
| 40 | + - name: Checkout the repository |
| 41 | + uses: actions/checkout@v4 |
| 42 | + - name: Setup tools |
| 43 | + uses: jdx/mise-action@#v2 |
| 44 | + - name: Install dependencies |
| 45 | + run: bun install --frozen-lockfile |
| 46 | + - name: Lint Markdown using textlint |
| 47 | + run: bun run --bun textlint-md |
| 48 | + |
| 49 | + textlint-html: |
| 50 | + runs-on: ubuntu-24.04 |
| 51 | + needs: build-and-deploy |
| 52 | + steps: |
| 53 | + - name: Checkout the repository |
| 54 | + uses: actions/checkout@v4 |
| 55 | + - name: Download build artifacts |
| 56 | + uses: actions/download-artifact@v4 |
| 57 | + with: |
| 58 | + name: build-artifacts |
| 59 | + path: dist |
| 60 | + - uses: jdx/mise-action@v2 |
| 61 | + - name: Install dependencies |
| 62 | + run: bun install --frozen-lockfile |
| 63 | + - name: Lint HTML using textlint |
| 64 | + run: bun run --bun textlint-html |
0 commit comments