1name: Create Versioned Docs Release
2
3on:
4 workflow_dispatch:
5 inputs:
6 version:
7 description: "Version number (e.g. 2.0). Becomes `website/versioned_docs/version-{version_number}.x`."
8 required: true
9 type: string
10 base_branch:
11 description: "Git branch to copy from as the versioned docs."
12 required: false
13 default: "trunk"
14 type: string
15
16permissions:
17 contents: write
18 pull-requests: write
19
20jobs:
21 create-release:
22 runs-on: ubuntu-latest
23 steps:
24 - name: Checkout base branch
25 uses: actions/checkout@v4
26 with:
27 ref: ${{ inputs.base_branch }}
28
29 - name: Overlay docs from base branch
30 env:
31 BASE_BRANCH: ${{ inputs.base_branch }}
32 run: |
33 if ! git check-ref-format --branch "$BASE_BRANCH" > /dev/null; then
34 echo "Invalid base branch: $BASE_BRANCH" >&2
35 exit 1
36 fi
37 git fetch origin "refs/heads/$BASE_BRANCH"
38 git checkout FETCH_HEAD -- website/docs
39
40 - name: Create release branch and run release script
41 working-directory: website
42 run: |
43 git checkout -b "release/docs-v${{ inputs.version }}-${{ github.run_id }}"
44 ./create-release.sh "${{ inputs.version }}"
45
46 - name: Commit and push
47 run: |
48 git config user.name "github-actions[bot]"
49 git config user.email "github-actions[bot]@users.noreply.github.com"
50 git checkout trunk -- website/docs
51 git add -A
52 git commit -m "Add versioned docs for v${{ inputs.version }}"
53 git push origin "release/docs-v${{ inputs.version }}-${{ github.run_id }}"
54
55 - name: Create Pull Request
56 env:
57 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 run: |
59 gh pr create \
60 --base trunk \
61 --head "release/docs-v${{ inputs.version }}-${{ github.run_id }}" \
62 --title "Add versioned docs for v${{ inputs.version }}" \
63 --body "Creates versioned documentation snapshot for v${{ inputs.version }}." \
64 --label "area/docs"
65
1name: Create Versioned Docs Release
2
3on:
4 workflow_dispatch:
5 inputs:
6 version:
7 description: "Version number (e.g. 2.0). Becomes `website/versioned_docs/version-{version_number}.x`."
8 required: true
9 type: string
10 base_branch:
11 description: "Git branch to copy from as the versioned docs."
12 required: false
13 default: "trunk"
14 type: string
15
16permissions:
17 contents: write
18 pull-requests: write
19
20jobs:
21 create-release:
22 runs-on: ubuntu-latest
23 steps:
24 - name: Checkout base branch
25 uses: actions/checkout@v4
26 with:
27 ref: ${{ inputs.base_branch }}
28
29 - name: Overlay docs from base branch
30 env:
31 BASE_BRANCH: ${{ inputs.base_branch }}
32 run: |
33 if ! git check-ref-format --branch "$BASE_BRANCH" > /dev/null; then
34 echo "Invalid base branch: $BASE_BRANCH" >&2
35 exit 1
36 fi
37 git fetch origin "refs/heads/$BASE_BRANCH"
38 git checkout FETCH_HEAD -- website/docs
39
40 - name: Create release branch and run release script
41 working-directory: website
42 run: |
43 git checkout -b "release/docs-v${{ inputs.version }}-${{ github.run_id }}"
44 ./create-release.sh "${{ inputs.version }}"
45
46 - name: Commit and push
47 run: |
48 git config user.name "github-actions[bot]"
49 git config user.email "github-actions[bot]@users.noreply.github.com"
50 git checkout trunk -- website/docs
51 git add -A
52 git commit -m "Add versioned docs for v${{ inputs.version }}"
53 git push origin "release/docs-v${{ inputs.version }}-${{ github.run_id }}"
54
55 - name: Create Pull Request
56 env:
57 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 run: |
59 gh pr create \
60 --base trunk \
61 --head "release/docs-v${{ inputs.version }}-${{ github.run_id }}" \
62 --title "Add versioned docs for v${{ inputs.version }}" \
63 --body "Creates versioned documentation snapshot for v${{ inputs.version }}." \
64 --label "area/docs"
65
