This is an automated email from the ASF dual-hosted git repository. jamesfredley pushed a commit to branch ci/publish-docs-workflow in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 6fe1360fca119e9cf2bef40bc93ba3f7657744c1 Author: James Fredley <[email protected]> AuthorDate: Sat Jan 31 21:33:02 2026 -0500 Add standalone workflow for publishing documentation --- .github/workflows/publish-docs.yml | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000000..ead3f33ee7 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,82 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: "Publish Documentation" +on: + workflow_dispatch: + inputs: + tag: + description: 'Release tag (e.g., v7.0.0)' + required: true + type: string + target_branch: + description: 'Target branch (e.g., 7.0.x)' + required: true + type: string +permissions: { } +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JAVA_DISTRIBUTION: liberica + JAVA_VERSION: 17.0.18 + TAG: ${{ inputs.tag }} + TARGET_BRANCH: ${{ inputs.target_branch }} + VERSION: will be computed +jobs: + docs: + environment: docs + name: "Publish Documentation" + runs-on: ubuntu-24.04 + steps: + - name: "📝 Establish release version" + run: echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" + - name: "⚙️ Maximize build space" + uses: easimon/maximize-build-space@c28619d8999a147d5e09c1199f84ff6af6ad5794 + with: + root-reserve-mb: 4096 # Leave ~4 GB on root FS (default) + swap-size-mb: 2048 # Allocate 2 GB swap (default: 4 GB; reduce if not needed) + remove-dotnet: 'true' # Remove .NET SDK (~3-4 GB savings) + remove-android: 'true' # Remove Android tools (~2 GB savings) + remove-haskell: 'true' # Remove Haskell (~1 GB savings) + remove-codeql: 'true' # Remove CodeQL (~500 MB savings) + remove-docker-images: 'false' # Prune Docker if used (~1-2 GB savings) + - name: "📥 Checkout repository" + uses: actions/checkout@v5 + with: + fetch-depth: 0 # needed for docs release dropdown, (fetch-tags: true with fetch-depth: 1 does not work; https://github.com/actions/checkout/issues/1471) + filter: tree:0 # limit size, keeping tags for docs release dropdown + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ env.TAG }} + - name: "📅 Ensure Common Build Date" # to ensure a reproducible build + run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" + - name: "☕️ Setup JDK" + uses: actions/setup-java@v5 + with: + distribution: ${{ env.JAVA_DISTRIBUTION }} + java-version: ${{ env.JAVA_VERSION }} + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v5 + with: + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} + - name: "📖 Generate Documentation" + run: ./gradlew grails-doc:build -PgithubBranch=${TARGET_BRANCH} + - name: "🚀 Publish to GitHub Pages" + uses: apache/grails-github-actions/deploy-github-pages@asf + env: + GH_TOKEN: ${{ secrets.GRAILS_GHTOKEN }} # To be able to push to grails-website repo + GRADLE_PUBLISH_RELEASE: 'true' + SOURCE_FOLDER: grails-doc/build/docs + TARGET_REPOSITORY: apache/grails-website + TARGET_FOLDER: docs + DOCUMENTATION_BRANCH: asf-site-production
