aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/docs.yml
blob: 74530c40e1f7708c3c7db6922c55c94014e35e13 (plain) (blame)
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
name: Docs upload

on:
  push:
    branches: ["main"]
  workflow_dispatch:

jobs:
  upload-docs:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload docs to GitHub Pages
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: ./.github/actions/setup-python
      - name: Bootstrap
        run: |
          sudo apt update
          python3 ./mach bootstrap --skip-lints
      - name: Set LIBCLANG_PATH # This is needed for bindgen in mozangle.
        run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
      - name: Compile docs
        run: python3 ./mach doc
        env:
          RUSTDOCFLAGS: --document-private-items
      - name: Upload docs
        run: |
          cd target/doc
          git config --global init.defaultBranch main
          git init
          git add .
          git -c user.name="Workflow" -c user.email="" \
              commit -q -m "Rebuild Servo documentation"
          git remote add origin https://git:${DOC_SERVO_ORG}@github.com/servo/doc.servo.org
          git push --force origin main:gh-pages
        env:
          DOC_SERVO_ORG: ${{ secrets.DOC_SERVO_ORG }}