Update gradle.yml #191
This file contains 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: Java CI | |
on: | |
push: | |
branches: | |
- '[4-9]+.[0-9]+.x' | |
pull_request: | |
branches: | |
- '[4-9]+.[0-9]+.x' | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: ['11'] | |
env: | |
GIT_USER_NAME: puneetbehl | |
GIT_USER_EMAIL: [email protected] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: gradle/wrapper-validation-action@v1 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java }} | |
- name: Extract branch name | |
if: success() | |
id: extract_branch | |
run: | | |
if [ ${GITHUB_EVENT_NAME} == "pull_request" ]; then | |
echo "value=${GITHUB_BASE_REF:11}" >> $GITHUB_OUTPUT | |
else | |
echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT | |
fi | |
- name: Build Documentation | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build -PgithubBranch=${{ steps.extract_branch.outputs.value }} | |
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 }} | |
- name: Upload Docs Artifacts | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: grails-docs.zip | |
path: ./build/distributions/grails-docs-*.zip | |
- name: Determine docs target repository | |
if: success() | |
uses: haya14busa/action-cond@v1 | |
id: docs_target | |
with: | |
cond: ${{ github.repository == 'grails/grails-doc' }} | |
if_true: 'grails/grails-doc' | |
if_false: ${{ github.repository }} | |
- name: Publish to Github Pages | |
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/6.0.x' | |
uses: micronaut-projects/github-pages-deploy-action@grails | |
env: | |
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
BRANCH: gh-pages | |
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') }} | |
FOLDER: build/docs | |
DOC_FOLDER: gh-pages | |
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | |
COMMIT_NAME: ${{ env.GIT_USER_NAME }} |