Skip to content

Commit 8e41604

Browse files
committed
Release the Python documentation as a ZIP archive on Git tags
Stop deploying it directly. khiops-doc would do this.
1 parent ea474fb commit 8e41604

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

.github/workflows/api-docs.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ env:
55
on:
66
workflow_dispatch:
77
inputs:
8-
deploy-gh-pages:
9-
description: Deploy GH Pages
10-
required: true
11-
type: boolean
12-
default: false
138
khiops-python-tutorial-revision:
149
default: main
1510
description: khiops-python-tutorial repo revision
@@ -24,6 +19,8 @@ on:
2419
- doc/*.py
2520
- khiops/**.py
2621
- .github/workflows/api-docs.yml
22+
push:
23+
tags: ['*']
2724
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
2825
permissions:
2926
contents: read
@@ -80,20 +77,36 @@ jobs:
8077
cd doc
8178
./create-doc -t
8279
- name: Upload the docs as an artifact
83-
uses: actions/upload-pages-artifact@v3
80+
uses: actions/upload-artifact@v4
8481
with:
85-
path: doc/_build/html/
86-
# Deploy only when the user explicitly (and manually) orders it
87-
deploy:
88-
if: github.event_name == 'workflow_dispatch' && inputs.deploy-gh-pages == true
89-
runs-on: ubuntu-latest
82+
name: api-docs
83+
path: ./doc/_build/html/
84+
# Release on Git tag
85+
release:
86+
if: github.ref_type == 'tag'
9087
needs: build
91-
environment:
92-
name: github-pages
93-
url: ${{ steps.deployment.outputs.page_url }}
88+
runs-on: ubuntu-22.04
89+
permissions:
90+
contents: write
9491
steps:
95-
- name: Setup Pages
96-
uses: actions/configure-pages@v4
97-
- name: Deploy API Docs to GitHub Pages
98-
id: deployment
99-
uses: actions/deploy-pages@v4
92+
- name: Download docs artifact
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: api-docs
96+
path: ./doc/_build/html/
97+
- name: Create docs release zip archive
98+
uses: thedoctor0/zip-release@0.7.6
99+
with:
100+
type: zip
101+
path: ./doc/_build/html/
102+
filename: khiops-api-docs-${{ github.ref_name }}.zip
103+
- name: Release the docs zip archive
104+
uses: ncipollo/release-action@v1.15.0
105+
with:
106+
allowUpdates: true
107+
artifacts: ./khiops-api-docs-${{ github.ref_name }}.zip
108+
body: '**For testing purposes only**'
109+
draft: false
110+
makeLatest: false
111+
prerelease: true
112+
updateOnlyUnreleased: true

0 commit comments

Comments
 (0)