File: docs.yml

package info (click to toggle)
stac-validator 3.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,120 kB
  • sloc: python: 3,347; makefile: 100
file content (62 lines) | stat: -rw-r--r-- 1,669 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
name: Documentation

on:
  push:
    branches: [ main ]
    paths:
      - 'docs/**'
      - 'stac_validator/**/*.py'
      - 'README.md'
  pull_request:
    branches: [ main ]
    paths:
      - 'docs/**'
      - 'stac_validator/**/*.py'
      - 'README.md'
  # Allow manual triggering
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: '3.8'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -e .
        pip install sphinx sphinx_rtd_theme myst-parser sphinx-autodoc-typehints
    - name: Build documentation
      run: |
        sphinx-build -b html docs/ docs/_build/html
    - name: Upload documentation artifact
      uses: actions/upload-artifact@v4
      with:
        name: documentation
        path: docs/_build/html
        retention-days: 7

  # Only deploy when pushing to main (not on PRs)
  deploy:
    needs: build
    if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Download built documentation
        uses: actions/download-artifact@v4
        with:
          name: documentation
          path: ./docs-build
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs-build
          force_orphan: true
          commit_message: "Update documentation [skip ci]"