Debian Codegraph @

.github/workflows/docs.yml

raw
1 name: Docs
2
3 on:
4 push:
5 branches:
6 - main
7 - '*-1.0'
8 - 'dev-*'
9 paths:
10 - '.github/**'
11 - '*gradle*'
12 - 'docs/**'
13 - 'gradle/**'
14 pull_request:
15 branches:
16 - main
17 - '*-1.0'
18 - 'dev-*'
19 paths:
20 - '.github/**'
21 - '*gradle*'
22 - 'docs/**'
23 - 'gradle/**'
24
25 jobs:
26 # Runs on PRs and push to ensure the documentation successfully builds.
27 build:
28 name: Build Documentation
29 runs-on: ubuntu-latest
30 env:
31 JAVA_VERSION: 22
32 steps:
33 - name: Check out project
34 uses: actions/checkout@v4
35
36 - name: Set up Java
37 uses: actions/setup-java@v4
38 with:
39 distribution: temurin
40 java-version: ${{ env.JAVA_VERSION }}
41
42 - name: Set up Gradle
43 uses: gradle/actions/setup-gradle@v3
44
45 - name: Build docs
46 run: ./gradlew buildDocs
47
48 - name: Upload artifact
49 uses: actions/upload-pages-artifact@v3
50 with:
51 path: docs/build
52
53 # Deploys the documentation if this is a push to the main branch.
54 deploy:
55 name: Deploy Documentation
56 if: github.event_name == 'push' && github.ref == 'refs/heads/main'
57 needs: build
58 runs-on: ubuntu-latest
59
60 # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
61 permissions:
62 pages: write # to deploy to Pages
63 id-token: write # to verify the deployment originates from an appropriate source
64
65 # Deploy to the github-pages environment
66 environment:
67 name: github-pages
68 url: ${{ steps.deployment.outputs.page_url }}
69
70 steps:
71 - name: Deploy to GitHub Pages
72 id: deployment
73 uses: actions/deploy-pages@v4