|
5 | 5 | on: |
6 | 6 | workflow_dispatch: |
7 | 7 | inputs: |
8 | | - deploy-gh-pages: |
9 | | - description: Deploy GH Pages |
10 | | - required: true |
11 | | - type: boolean |
12 | | - default: false |
13 | 8 | khiops-python-tutorial-revision: |
14 | 9 | default: main |
15 | 10 | description: khiops-python-tutorial repo revision |
|
24 | 19 | - doc/*.py |
25 | 20 | - khiops/**.py |
26 | 21 | - .github/workflows/api-docs.yml |
| 22 | + push: |
| 23 | + tags: ['*'] |
27 | 24 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
28 | 25 | permissions: |
29 | 26 | contents: read |
@@ -80,20 +77,36 @@ jobs: |
80 | 77 | cd doc |
81 | 78 | ./create-doc -t |
82 | 79 | - name: Upload the docs as an artifact |
83 | | - uses: actions/upload-pages-artifact@v3 |
| 80 | + uses: actions/upload-artifact@v4 |
84 | 81 | 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' |
90 | 87 | 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 |
94 | 91 | 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