|
| 1 | +name: Publish Documentation to sites.ecmwf.int |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + types: [opened, synchronize, reopened, closed] |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'develop' |
| 8 | + - 'master' |
| 9 | + tags: |
| 10 | + - '**' |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' || github.event_name == 'push'}} |
| 14 | + runs-on: ubuntu-latest |
| 15 | + outputs: |
| 16 | + artifact-id: ${{ steps.upload-doc.outputs.artifact-id }} |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + - name: Setup Python |
| 21 | + uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: '3.13' |
| 24 | + - name: Install python dependencies |
| 25 | + run: | |
| 26 | + python -m pip install -r docs/requirements.txt |
| 27 | + - name: Prepare Doxygen |
| 28 | + uses: ecmwf/reusable-workflows/setup-doxygen@main |
| 29 | + with: |
| 30 | + version: 1.14.0 |
| 31 | + - name: Build doc |
| 32 | + run: | |
| 33 | + cd docs |
| 34 | + make -j html |
| 35 | + - name: Archive documentation |
| 36 | + id: upload-doc |
| 37 | + uses: actions/upload-artifact@v4 |
| 38 | + with: |
| 39 | + name: documentation |
| 40 | + path: docs/_build/html |
| 41 | + preview-publish: |
| 42 | + if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }} |
| 43 | + needs: build |
| 44 | + uses: ecmwf/reusable-workflows/.github/workflows/pr-preview-publish.yml@main |
| 45 | + with: |
| 46 | + artifact-id: ${{ needs.build.outputs.artifact-id }} |
| 47 | + space: docs |
| 48 | + name: dev-section |
| 49 | + path: eckit/pull-requests |
| 50 | + link-text: 🌦️ >> Documentation << 🌦️ |
| 51 | + secrets: |
| 52 | + sites-token: ${{ secrets.ECMWF_SITES_DOCS_DEV_SECTION_TOKEN }} |
| 53 | + preview-unpublish: |
| 54 | + if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} |
| 55 | + uses: ecmwf/reusable-workflows/.github/workflows/pr-preview-unpublish.yml@main |
| 56 | + with: |
| 57 | + space: docs |
| 58 | + name: dev-section |
| 59 | + path: eckit/pull-requests |
| 60 | + secrets: |
| 61 | + sites-token: ${{ secrets.ECMWF_SITES_DOCS_DEV_SECTION_TOKEN }} |
| 62 | + publish: |
| 63 | + if: >- |
| 64 | + ${{ github.event_name == 'push' && ( |
| 65 | + github.ref_name == 'develop' || |
| 66 | + github.ref_name == 'master' || |
| 67 | + github.ref_type == 'tag' |
| 68 | + ) }} |
| 69 | + needs: build |
| 70 | + uses: ecmwf/reusable-workflows/.github/workflows/docs-publish.yml@main |
| 71 | + with: |
| 72 | + artifact-id: ${{ needs.build.outputs.artifact-id }} |
| 73 | + space: docs |
| 74 | + name: dev-section |
| 75 | + path: eckit |
| 76 | + id: ${{ github.ref_name }} |
| 77 | + softlink: ${{ github.ref_name == 'master' && 'stable' |
| 78 | + || github.ref_name == 'develop' && 'latest' }} |
| 79 | + secrets: |
| 80 | + sites-token: ${{ secrets.ECMWF_SITES_DOCS_DEV_SECTION_TOKEN }} |
0 commit comments