Create Versioned Docs Release #3
This file contains hidden or 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: Create Versioned Docs Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version number (e.g. 2.0)" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout trunk | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: trunk | |
| - name: Create release branch and run release script | |
| working-directory: website | |
| run: | | |
| git checkout -b "release/docs-v${{ inputs.version }}" | |
| ./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 add -A | |
| git commit -m "Add versioned docs for v${{ inputs.version }}" | |
| git push origin "release/docs-v${{ inputs.version }}" | |
| - name: Create Pull Request | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr create \ | |
| --base trunk \ | |
| --head "release/docs-v${{ inputs.version }}" \ | |
| --title "Add versioned docs for v${{ inputs.version }}" \ | |
| --body "Creates versioned documentation snapshot for v${{ inputs.version }}." \ | |
| --label "area/docs" |