-
Notifications
You must be signed in to change notification settings - Fork 536
59 lines (59 loc) · 2.3 KB
/
gradle.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
name: Java CI
on:
push:
branches:
- '[4-9]+.[0-9]+.x'
pull_request:
branches:
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
env:
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: '[email protected]'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H%M%S')" >> $GITHUB_ENV
- uses: actions/setup-java@v4
with: { java-version: 17, distribution: temurin }
- name: Extract branch name
id: extract_branch
run: echo "value=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Build Snapshot Documentation
uses: gradle/actions/setup-gradle@v3
env:
TARGET_GRAILS_VERSION: ${{ github.event.inputs.grails_version }}
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: |
build
-PgithubBranch=${{ steps.extract_branch.outputs.value }}
- name: Upload Docs Artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: grails-docs-${{ env.NOW }}.zip
path: ./build/distributions/*.zip
- name: Publish Snapshot Documentation to Github Pages
if: success() && github.event_name == 'push'
uses: grails/github-pages-deploy-action@v2
env:
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: build/docs
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TARGET_REPOSITORY: ${{ github.repository }}
SKIP_SNAPSHOT: ${{
startsWith(steps.extract_branch.outputs.value, '3.3') ||
startsWith(steps.extract_branch.outputs.value, '4.1') ||
startsWith(steps.extract_branch.outputs.value, '5.3') ||
startsWith(steps.extract_branch.outputs.value, '7.0')
}}