File: docs.yml

package info (click to toggle)
python-libtmux 0.47.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,392 kB
  • sloc: python: 7,715; makefile: 199; sh: 21
file content (79 lines) | stat: -rw-r--r-- 2,345 bytes parent folder | download
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
name: docs

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.14']
    steps:
      - uses: actions/checkout@v4

      - name: Filter changed file paths to outputs
        uses: dorny/paths-filter@v3.0.2
        id: changes
        with:
          filters: |
            root_docs:
              - CHANGES
              - README.*
            docs:
              - 'docs/**'
              - 'examples/**'
            python_files:
              - 'src/libtmux/**'
              - uv.lock
              - pyproject.toml

      - name: Should publish
        if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
        run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV

      - name: Install uv
        if: env.PUBLISH == 'true'
        uses: astral-sh/setup-uv@v5
        with:
          enable-cache: true

      - name: Set up Python ${{ matrix.python-version }}
        if: env.PUBLISH == 'true'
        run: uv python install ${{ matrix.python-version }}

      - name: Install dependencies [w/ docs]
        if: env.PUBLISH == 'true'
        run: uv sync --all-extras --dev

      - name: Print python versions
        if: env.PUBLISH == 'true'
        run: |
          python -V
          uv run python -V

      - name: Build documentation
        if: env.PUBLISH == 'true'
        run: |
          pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd

      - name: Push documentation to S3
        uses: jakejarvis/s3-sync-action@v0.5.1
        if: env.PUBLISH == 'true'
        with:
          args: --acl public-read --follow-symlinks --delete
        env:
          AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
          SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository

      - name: Purge cache on Cloudflare
        if: env.PUBLISH == 'true'
        uses: jakejarvis/cloudflare-purge-action@v0.3.0
        env:
          CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
          CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}