Skip to content

Commit ceb75b2

Browse files
committed
Add GitHub Action for deploying docs to GitHub Pages
0 parents  commit ceb75b2

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: deploy-docs
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: 'Release tag to deploy (e.g. wxPython-4.2.5)'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
deploy:
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
27+
steps:
28+
- name: Download docs asset from Phoenix release
29+
run: |
30+
ASSET_URL=$(curl -s "https://api.github.com/repos/wxWidgets/Phoenix/releases/tags/${{ inputs.release_tag }}" \
31+
| jq -r '.assets[] | select(.name | startswith("wxPython-docs-")) | .browser_download_url')
32+
curl -L -o wxPython-docs.tar.gz "$ASSET_URL"
33+
34+
- name: Extract docs
35+
run: |
36+
mkdir html
37+
tar -xzf wxPython-docs.tar.gz --strip-components=3 -C html
38+
39+
- name: Upload Pages artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: html
43+
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)