Exclude docs from build #314
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' | |
jobs: | |
# build and test, then upload logs if failure | |
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 build | |
- name: Tar Build Logs | |
if: ${{ failure() }} | |
run: | | |
mkdir -p build | |
tar \ | |
-zc \ | |
--ignore-failed-read \ | |
--file build/buildlogs.tar.gz \ | |
*/build/reports \ | |
*/*/build/reports | |
- name: Upload Build Logs | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4.6.2 | |
with: | |
name: buildlogs | |
path: build/buildlogs.tar.gz | |
# if build job succeed, build without tests and publish | |
publish: | |
needs: 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 -x test clean build publishToMavenLocal | |
- name: Deploy | |
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' | |
signing-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} |