Setup Grace docs workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Grace Doc | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| jobs: | |
| # Build job | |
| build: | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: ['17'] | |
| steps: | |
| - name: Checkout repository | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'adopt' | |
| java-version: ${{ matrix.java }} | |
| - name: Get the current version | |
| id: current_version | |
| run: | | |
| echo "$(cat gradle.properties | grep 'projectVersion=' | awk '{print $1}')" >> "$GITHUB_OUTPUT" | |
| - name: Generate Docs | |
| id: build | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| arguments: docs | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: rainboyan/[email protected] | |
| env: | |
| VERSION: ${{ steps.current_version.outputs.projectVersion }} | |
| TOKEN: ${{ secrets.GH_TOKEN }} | |
| BRANCH: gh-pages | |
| FOLDER: build/docs |