|
8 | 8 | required: false |
9 | 9 | push: |
10 | 10 | branches: docs-build |
11 | | -env: |
12 | | - GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} |
13 | | -permissions: read-all |
| 11 | +permissions: |
| 12 | + contents: write |
14 | 13 | jobs: |
15 | 14 | build: |
16 | 15 | if: github.repository_owner == 'spring-projects' |
17 | 16 | runs-on: ubuntu-latest |
18 | 17 | steps: |
19 | | - - name: Checkout |
20 | | - uses: actions/checkout@v3 |
21 | | - with: |
22 | | - fetch-depth: 5 |
23 | | - - name: Set Up Gradle |
24 | | - uses: spring-io/spring-gradle-build-action@v2 |
25 | | - with: |
26 | | - java-version: '17' |
27 | | - distribution: temurin |
28 | | - - name: Set up refname build |
29 | | - if: github.event.inputs.build-refname |
30 | | - run: | |
31 | | - git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }} |
32 | | - echo BUILD_REFNAME=${{ github.event.inputs.build-refname }} >> $GITHUB_ENV |
33 | | - echo BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:gradle.properties | sed -n '/^version=/ { s/^version=//;p }') >> $GITHUB_ENV |
34 | | - - name: Run Antora |
35 | | - run: ./gradlew antora |
36 | | - - name: Copy the cache to be included in the site |
37 | | - run: cp -rf build/antora/inject-collector-cache-config-extension/.cache build/site/ |
38 | | - - name: Publish Docs |
39 | | - uses: spring-io/spring-doc-actions/[email protected] |
40 | | - with: |
41 | | - docs-username: ${{ secrets.DOCS_USERNAME }} |
42 | | - docs-host: ${{ secrets.DOCS_HOST }} |
43 | | - docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }} |
44 | | - docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }} |
45 | | - - name: Bust Clouflare Cache |
46 | | - uses: spring-io/spring-doc-actions/[email protected] |
47 | | - with: |
48 | | - context-root: spring-shell |
49 | | - cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }} |
50 | | - cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }} |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v3 |
| 20 | + - name: Set up JDK 17 |
| 21 | + uses: actions/setup-java@v3 |
| 22 | + with: |
| 23 | + java-version: '17' |
| 24 | + distribution: 'temurin' |
| 25 | + - name: Set up refname build |
| 26 | + if: github.event.inputs.build-refname |
| 27 | + run: | |
| 28 | + git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }} |
| 29 | + export BUILD_REFNAME=${{ github.event.inputs.build-refname }} |
| 30 | + echo "BUILD_REFNAME=$BUILD_REFNAME" >> $GITHUB_ENV |
| 31 | + export BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:pom.xml | python3 -c "import xml.etree.ElementTree as xml; from sys import stdin; print(xml.parse(stdin).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)") |
| 32 | + echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV |
| 33 | + - name: Run Antora |
| 34 | + run: | |
| 35 | + ./mvnw antora |
| 36 | + - name: Publish Docs |
| 37 | + uses: spring-io/spring-doc-actions/[email protected] |
| 38 | + with: |
| 39 | + docs-username: ${{ secrets.DOCS_USERNAME }} |
| 40 | + docs-host: ${{ secrets.DOCS_HOST }} |
| 41 | + docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }} |
| 42 | + docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }} |
| 43 | + site-path: target/antora/site |
| 44 | + - name: Bust Cloudflare Cache |
| 45 | + uses: spring-io/spring-doc-actions/[email protected] |
| 46 | + with: |
| 47 | + context-root: spring-shell |
| 48 | + cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }} |
| 49 | + cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }} |
0 commit comments