aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/docs.yml
blob: eb432751ffcf6d4b393cf784c89e2d4dd73f5001 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
name: "Build docs"
on:
  push:
  workflow_dispatch:
  release:
    types: [published]
jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: apt-get update
        run: sudo apt-get update
      - name: Install external dependencies
        run: sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y
      - name: Install uv and Python
        uses: astral-sh/setup-uv@v6
        with:
          python-version: ${{ matrix.python-version }}
          enable-cache: true
      - name: Install sec-certs
        run: |
          uv sync --locked --dev
      - name: Build docs
        run: |
          cd docs
          uv run make html
      - name: Save docs artifact
        uses: actions/upload-artifact@v4.4.0
        with:
          name: docs
          path: docs/_build/html/
          retention-days: 7
  upload:
    runs-on: ubuntu-latest
    needs: build
    if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') && github.repository == 'crocs-muni/sec-certs' # Potentially change this into a check on release.
    steps:
      - name: Get docs artifact
        uses: actions/download-artifact@v4.1.8
        with:
          name: docs
          path: docs
      - name: Archive docs
        run: |
          cd docs
          zip -r docs.zip *
      - name: Push docs to website
        run: |
          curl -F data=@docs/docs.zip https://sec-certs.org/docs/upload?token=${{ secrets.DOCS_AUTH_TOKEN }}