Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ on:
workflow_dispatch:
inputs:
version:
description: "Version number (e.g. 2.0)"
description: "Version number (e.g. 2.0). Becomes `website/versioned_docs/version-{version_number}.x`."
required: true
type: string
base_branch:
description: "Git branch to copy from as the versioned docs."
required: false
default: "trunk"
type: string

permissions:
contents: write
Expand All @@ -21,27 +26,33 @@ jobs:
with:
ref: trunk

- name: Overlay docs from base branch
run: |
git fetch origin ${{ inputs.base_branch }}
git checkout FETCH_HEAD -- website/docs

- name: Create release branch and run release script
working-directory: website
run: |
git checkout -b "release/docs-v${{ inputs.version }}"
git checkout -b "release/docs-v${{ inputs.version }}-${{ github.run_id }}"
./create-release.sh "${{ inputs.version }}"

- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout trunk -- website/docs
git add -A
git commit -m "Add versioned docs for v${{ inputs.version }}"
git push origin "release/docs-v${{ inputs.version }}"
git push origin "release/docs-v${{ inputs.version }}-${{ github.run_id }}"

- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base trunk \
--head "release/docs-v${{ inputs.version }}" \
--head "release/docs-v${{ inputs.version }}-${{ github.run_id }}" \
--title "Add versioned docs for v${{ inputs.version }}" \
--body "Creates versioned documentation snapshot for v${{ inputs.version }}." \
--label "area/docs"
Loading