-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathspring-build-and-deploy-docs.yml
More file actions
66 lines (56 loc) · 2 KB
/
Copy pathspring-build-and-deploy-docs.yml
File metadata and controls
66 lines (56 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build and Deploy Docs
on:
workflow_call:
inputs:
build-refname:
description: Enter git refname to build (e.g., 5.7.x).
required: false
type: string
secrets:
DEVELOCITY_ACCESS_KEY:
required: false
DOCS_USERNAME:
required: true
DOCS_HOST:
required: true
DOCS_SSH_KEY:
required: true
DOCS_SSH_HOST_KEY:
required: true
CLOUDFLARE_ZONE_ID:
required: true
CLOUDFLARE_CACHE_TOKEN:
required: true
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
jobs:
docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
show-progress: false
- uses: spring-io/spring-gradle-build-action@v2
- name: Set up refname build
if: inputs.build-refname
run: |
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ inputs.build-refname }}
echo BUILD_REFNAME=${{ inputs.build-refname }} >> $GITHUB_ENV
echo BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:gradle.properties | sed -n '/^version=/ { s/^version=//;p }') >> $GITHUB_ENV
- name: Run Antora
run: ./gradlew antora
- name: Copy the cache to be included in the site
run: cp -rf build/antora/inject-collector-cache-config-extension/.cache build/site/
- name: Publish Docs
uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.22
with:
docs-username: ${{ secrets.DOCS_USERNAME }}
docs-host: ${{ secrets.DOCS_HOST }}
docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
- name: Bust Cloudflare Cache
uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.22
with:
context-root: ${{ github.event.repository.name }}
cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}