Skip to content

Commit 4f575c6

Browse files
committed
Update deploy-docs.yml
1 parent 1d0f9a0 commit 4f575c6

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,42 @@ on:
88
required: false
99
push:
1010
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
1413
jobs:
1514
build:
1615
if: github.repository_owner == 'spring-projects'
1716
runs-on: ubuntu-latest
1817
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

Comments
 (0)