haystack/.github/workflows/promote_unstable_docs.yml
Stefano Fiorucci 8b08ba00fa
ci: use ubuntu-slim where makes sense (#10234)
* ci: use ubuntu-slim where makes sense

* revert some changes

* test more actions

* test sync docs too

* revert

* set go version
2025-12-12 14:57:32 +01:00

58 lines
2.0 KiB
YAML

name: Release new minor version docs
on:
push:
tags:
# Trigger this only for the first patch release of the new minor
- "v[0-9]+.[0-9]+.0"
# Exclude 1.x tags
- "!v1.[0-9]+.[0-9]+"
env:
PYTHON_VERSION: "3.9"
jobs:
promote:
runs-on: ubuntu-slim
steps:
- name: Checkout this repo
uses: actions/checkout@v6
# use VERSION.txt file from main branch
with:
ref: main
- name: Get version to release
id: version
shell: bash
# We only need `major.minor`. At this point, VERSION.txt contains the next version.
# For example, if we are releasing 2.20.0, VERSION.txt contains 2.21.0-rc0.
run: |
MAJOR=$(cut -d "." -f 1 < VERSION.txt)
MINOR=$(cut -d "." -f 2 < VERSION.txt)
MINOR=$((MINOR - 1))
echo "version=${MAJOR}.${MINOR}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@v6
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Promote unstable docs for Docusaurus
run: |
python ./.github/utils/promote_unstable_docs_docusaurus.py --version ${{ steps.version.outputs.version }}
- name: Create Pull Request with Docusaurus docs updates
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
commit-message: "Promote unstable docs for Haystack ${{ steps.version.outputs.version }}"
branch: promote-unstable-docs-${{ steps.version.outputs.version }}
base: main
title: "docs: promote unstable docs for Haystack ${{ steps.version.outputs.version }}"
add-paths: |
docs-website
body: |
This PR promotes the unstable docs for Haystack ${{ steps.version.outputs.version }} to stable.
It is expected to run at the time of the release.
You can inspect the docs preview and merge it. There should now be only one unstable version representing the next (main) branch.
reviewers: "${{ github.actor }}"