-
Notifications
You must be signed in to change notification settings - Fork 637
58 lines (51 loc) · 1.99 KB
/
ci.yml
File metadata and controls
58 lines (51 loc) · 1.99 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
name: CI
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '.github/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Spring Gradle Build Action
uses: spring-io/spring-gradle-build-action@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
run: ./gradlew -Dmaven.repo.local=$(pwd)/deployment-repository clean build distZip publishToMavenLocal
- name: Deploy artefacts
if: ${{ github.repository == 'spring-projects/spring-statemachine' && github.ref_name == 'main' }}
uses: spring-io/artifactory-deploy-action@v0.0.2
with:
uri: 'https://repo.spring.io'
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
build-name: 'spring-statemachine-main'
repository: 'libs-snapshot-local'
folder: 'deployment-repository'
- name: Deploy documentation
if: ${{ github.repository == 'spring-projects/spring-statemachine' && github.ref_name == 'main' }}
env:
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
DOCS_HOST: ${{ secrets.DOCS_HOST }}
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
DOCS_PATH: ${{ secrets.DOCS_PATH }}
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"
PROJECT_VERSION=$(cat gradle.properties | grep "version=" | cut -d '=' -f 2)
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $PROJECT_VERSION"
pushd build
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION
popd
pushd docs/build/docs
scp -i $HOME/.ssh/key -r asciidoc $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION/reference
popd