|
| 1 | +--- |
| 2 | +name: Docs |
| 3 | + |
| 4 | +on: # yamllint disable-line rule:truthy |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - 'releases/**' |
| 9 | + pull_request: |
| 10 | + types: [opened, synchronize, reopened] |
| 11 | + paths: |
| 12 | + - 'mule/docs/**' |
| 13 | + - '.github/workflows/docs.yaml' |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +permissions: read-all |
| 17 | + |
| 18 | +jobs: |
| 19 | + |
| 20 | + build: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + timeout-minutes: 3 |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + - name: Setup uv |
| 28 | + uses: astral-sh/setup-uv@v6 |
| 29 | + - name: Install dependencies |
| 30 | + run: uv sync && uv pip install ./mule |
| 31 | + - name: Build docs |
| 32 | + run: uv run make clean html |
| 33 | + working-directory: ./mule/docs |
| 34 | + # - id: permissions |
| 35 | + # name: Set permissions |
| 36 | + # run: | |
| 37 | + # chmod -c -R +rX "./doc/_build/html/" |
| 38 | + - name: Upload artifacts |
| 39 | + uses: actions/upload-pages-artifact@v4 |
| 40 | + with: |
| 41 | + name: github-pages |
| 42 | + path: ./mule/docs/_build/html |
| 43 | + - name: Minimize uv cache |
| 44 | + run: uv cache prune --ci |
| 45 | + |
| 46 | + # Deploy job |
| 47 | + deploy: |
| 48 | + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' |
| 49 | + # Add a dependency to the build job |
| 50 | + needs: build |
| 51 | + permissions: |
| 52 | + pages: write # to deploy to Pages |
| 53 | + id-token: write # to verify the deployment originates from an appropriate source |
| 54 | + # Deploy to the github-pages environment |
| 55 | + environment: |
| 56 | + name: github-pages |
| 57 | + url: ${{ steps.deployment.outputs.page_url }} |
| 58 | + # Specify runner + deployment step |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - name: Deploy to GitHub Pages |
| 62 | + id: deployment |
| 63 | + uses: actions/deploy-pages@v4 |
0 commit comments