From 633ecfe927952468e1852bb08ca4a2d1fe401db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a=20Cousido?= Date: Mon, 21 Apr 2025 12:15:35 +0200 Subject: [PATCH] feat: modified workflow for publishing 'next' version --- .github/workflows/docs-release.yml | 34 ++++++++++++++++++++++++------ _config.yml | 3 +++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index ed04c100c..606c39b26 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -1,13 +1,24 @@ name: Release Docs on: - workflow_dispatch: pull_request: types: [closed] branches: - 15.x.x + workflow_dispatch: + inputs: + BASELINE: + description: 'Baseline branch of documentation' + required: true + default: '15.x.x' + TARGET_FOLDER: + description: 'Target version folder' + required: true + default: 'next' + type: choice + options: + - 'v15' + - 'next' -env: - TARGET_PATH: v15 jobs: build-docs: @@ -16,13 +27,24 @@ jobs: if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(join(github.event.pull_request.labels.*.name, ', '), 'release-docs')) steps: - - uses: actions/checkout@v3 + - name: Process input parameters + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + TARGET_PATH="${{ github.event.inputs.TARGET_FOLDER }}" + else + TARGET_PATH="v15" + fi + echo "TARGET_PATH=$TARGET_PATH" >> "$GITHUB_ENV" + BASELINE_BRANCH=${{ github.event.inputs.BASELINE || github.ref }} + echo "BASELINE_BRANCH=${BASELINE_BRANCH#refs/heads/}" >> "$GITHUB_ENV" + + - uses: actions/checkout@v4 with: - ref: 15.x.x + ref: ${{ env.BASELINE_BRANCH }} fetch-depth: 0 - name: Bundler Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} diff --git a/_config.yml b/_config.yml index 219c1c159..2b7662f52 100644 --- a/_config.yml +++ b/_config.yml @@ -22,6 +22,9 @@ versions: - url: /docs/v15 title: 15.x.x selected: true + - url: /docs/next + title: next + selected: false page_excerpts: true