File: docs.yml

package info (click to toggle)
tmuxp 1.64.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,500 kB
  • sloc: python: 17,788; sh: 22; makefile: 6
file content (95 lines) | stat: -rw-r--r-- 2,653 bytes parent folder | download | duplicates (2)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: docs

on:
  push:
    branches:
      - master

permissions:
  contents: read
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    environment: docs
    strategy:
      matrix:
        python-version: ['3.14']
    steps:
      - uses: actions/checkout@v6
      - 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/tmuxp/**'
              - pyproject.toml
              - uv.lock

      - 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
        uses: astral-sh/setup-uv@v7
        if: env.PUBLISH == 'true'
        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
        if: env.PUBLISH == 'true'
        run: uv sync --all-extras --dev

      - name: Install just
        if: env.PUBLISH == 'true'
        uses: extractions/setup-just@v3

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

      - name: Build documentation
        if: env.PUBLISH == 'true'
        run: |
          cd docs && just html

      - name: Configure AWS Credentials
        if: env.PUBLISH == 'true'
        uses: aws-actions/configure-aws-credentials@v5
        with:
          role-to-assume: ${{ secrets.TMUXP_DOCS_ROLE_ARN }}
          aws-region: us-east-1

      - name: Push documentation to S3
        if: env.PUBLISH == 'true'
        run: |
          aws s3 sync docs/_build/html "s3://${{ secrets.TMUXP_DOCS_BUCKET }}" \
            --delete --follow-symlinks

      - name: Invalidate CloudFront
        if: env.PUBLISH == 'true'
        run: |
          aws cloudfront create-invalidation \
            --distribution-id "${{ secrets.TMUXP_DOCS_DISTRIBUTION }}" \
            --paths "/index.html" "/history.html" "/objects.inv" "/searchindex.js"

      - 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 }}