Merge pull request #168 from Danil-Grigorev/replace-clusterctl #27
Workflow file for this run
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: Publish new docs version | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
env: | |
TAG: ${{ github.ref_name }} | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: refs/tags/${{ env.TAG }} | |
- name: Prepare the tag | |
run: echo "TAG=${TAG#v}" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Create a new version | |
run: yarn docusaurus docs:version ${{ env.TAG }} | |
- name: Commit changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git checkout -b release-${{ env.TAG }} | |
git add . | |
git commit -m "Add docs version v${{ env.TAG }}" | |
git push origin release-${{ env.TAG }} | |
tag=${{ env.TAG }} | |
[[ $tag =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || tag+=.0 | |
echo -e "Update docs version v${tag}\\n\\nChangelog: https://github.com/rancher/turtles/releases/tag/v${tag}\\n\\ncc @rancher/highlander" > body | |
export body=$(cat body) | |
gh pr create --title 'turtles-docs release for turtles v${{ env.TAG }}' --body "$body" |