Skip to content

Commit aab80eb

Browse files
committed
Trigger a docs build when snapshots and releases are published
See gh-1009
1 parent 0f822b9 commit aab80eb

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

.github/workflows/build-and-deploy-snapshot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,14 @@ jobs:
4545
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
4646
outputs:
4747
version: ${{ steps.build-and-publish.outputs.version }}
48+
trigger-docs-build:
49+
name: Trigger Docs Build
50+
needs: build-and-deploy-snapshot
51+
permissions:
52+
actions: write
53+
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
54+
steps:
55+
- name: Run Deploy Docs Workflow
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
run: gh workflow run deploy-docs.yml --repo ${{ github.repository }} -r docs-build -f build-refname=${{ github.ref_name }} -f build-version=${{ needs.build-and-deploy-snapshot.outputs.version }}

.github/workflows/release-milestone.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ jobs:
6666
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
6767
- name: Promote Open Source Build
6868
run: jfrog rt build-promote ${{ format('spring-restdocs-{0}', needs.build-and-stage-release.outputs.version)}} ${{ github.run_number }} libs-milestone-local
69+
trigger-docs-build:
70+
name: Trigger Docs Build
71+
needs:
72+
- build-and-stage-release
73+
- sync-to-maven-central
74+
permissions:
75+
actions: write
76+
runs-on: ubuntu-latest
77+
steps:
78+
- name: Run Deploy Docs Workflow
79+
env:
80+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
run: gh workflow run deploy-docs.yml --repo ${{ github.repository }} -r docs-build -f build-refname=${{ github.ref_name }} -f build-version=${{ needs.build-and-stage-release.outputs.version }}
6982
create-github-release:
7083
name: Create GitHub Release
7184
needs:

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ jobs:
6565
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
6666
- name: Promote Open Source Build
6767
run: jfrog rt build-promote ${{ format('spring-restdocs-{0}', needs.build-and-stage-release.outputs.version)}} ${{ github.run_number }} libs-release-local
68+
trigger-docs-build:
69+
name: Trigger Docs Build
70+
needs:
71+
- build-and-stage-release
72+
- sync-to-maven-central
73+
permissions:
74+
actions: write
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Run Deploy Docs Workflow
78+
env:
79+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: gh workflow run deploy-docs.yml --repo ${{ github.repository }} -r docs-build -f build-refname=${{ github.ref_name }} -f build-version=${{ needs.build-and-stage-release.outputs.version }}
6881
create-github-release:
6982
name: Create GitHub Release
7083
needs:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Trigger Docs Build
2+
on:
3+
push:
4+
branches: 'main'
5+
paths: [ 'antora/*' ]
6+
workflow_dispatch:
7+
inputs:
8+
build-refname:
9+
description: 'Git refname to build (e.g., 1.0.x)'
10+
required: false
11+
build-version:
12+
description: 'Version being build (e.g. 1.0.3-SNAPSHOT)'
13+
required: false
14+
permissions:
15+
contents: read
16+
jobs:
17+
trigger-docs-build:
18+
name: Trigger Docs Build
19+
if: github.repository_owner == 'spring-projects'
20+
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
21+
permissions:
22+
actions: write
23+
steps:
24+
- name: Check Out
25+
uses: actions/checkout@v4
26+
with:
27+
ref: docs-build
28+
- name: Trigger Workflow
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: gh workflow run deploy-docs.yml -r docs-build -f build-refname=${{ github.event.inputs.build-refname }} -f build-version=${{ github.event.inputs.build-version }}

0 commit comments

Comments
 (0)