-
Notifications
You must be signed in to change notification settings - Fork 2.4k
63 lines (52 loc) · 2.1 KB
/
documentation-upload.yml
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
name: Documentation Upload
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Release version"
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Capture release version
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Update release version
run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
- name: Generate Java docs
run: mvn javadoc:aggregate
- name: Generate Assembly
working-directory: spring-batch-docs
run: mvn assembly:single
- name: Setup SSH key
env:
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
run: |
mkdir "$HOME/.ssh"
echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key"
chmod 600 "$HOME/.ssh/key"
echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
- name: Deploy Java docs and xsd schemas
env:
DOCS_HOST: ${{ secrets.DOCS_HOST }}
DOCS_PATH: ${{ secrets.DOCS_PATH }}
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
BATCH_SCHEMA_PATH: ${{ secrets.BATCH_SCHEMA_PATH }}
INTEGRATION_SCHEMA_PATH: ${{ secrets.INTEGRATION_SCHEMA_PATH }}
working-directory: spring-batch-docs/target
run: |
unzip spring-batch-$RELEASE_VERSION-javadocs.zip
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $RELEASE_VERSION"
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$RELEASE_VERSION
unzip spring-batch-$RELEASE_VERSION-schemas.zip
scp -i $HOME/.ssh/key batch/*.xsd $DOCS_USERNAME@$DOCS_HOST:$BATCH_SCHEMA_PATH
scp -i $HOME/.ssh/key batch-integration/*.xsd $DOCS_USERNAME@$DOCS_HOST:$INTEGRATION_SCHEMA_PATH