1212 description : PyPI project version (e.g. v0.1.0)
1313 required : false
1414
15+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
16+ permissions :
17+ contents : read
18+ pages : write
19+ id-token : write
20+
21+ # Allow only one concurrent deployment, skipping runs queued between the run
22+ # in-progress and latest queued. However, do NOT cancel in-progress runs as we
23+ # want to allow these production deployments to complete.
24+ concurrency :
25+ group : " pages"
26+ cancel-in-progress : false
27+
1528env :
1629 # Common versions
1730 PYTHON_VERSION : ' 3.11.5'
@@ -113,3 +126,36 @@ jobs:
113126 # be enabled, which makes sharing the account hard. We're waiting for
114127 # a crossplane org to be approved.
115128 password : ${{ secrets.PYPI_API_TOKEN }}
129+
130+
131+ docs :
132+ # The simple docs tool we're using doesn't support versions, so our docs
133+ # will only reflect what's in main.
134+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
135+ runs-on : ubuntu-22.04
136+ steps :
137+ - name : Checkout
138+ uses : actions/checkout@v4
139+
140+ - name : Setup Python
141+ uses : actions/setup-python@v5
142+ with :
143+ python-version : ${{ env.PYTHON_VERSION }}
144+
145+ - name : Setup Hatch
146+ run : pipx install hatch==1.7.0
147+
148+ - name : Build Documentation
149+ run : hatch run docs:pdoc -d google crossplane/function -o docs
150+
151+ - name : Setup Pages
152+ uses : actions/configure-pages@v4
153+
154+ - name : Upload artifact
155+ uses : actions/upload-pages-artifact@v3
156+ with :
157+ path : docs
158+
159+ - name : Deploy to GitHub Pages
160+ id : deployment
161+ uses : actions/deploy-pages@v4
0 commit comments