File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Docs
2+
3+ on :
4+ release :
5+ types : [published]
6+ workflow_dispatch :
7+ inputs :
8+ source :
9+ description : " Tag or branch to publish to docs branch"
10+ required : true
11+
12+ jobs :
13+ publish-docs :
14+ name : Publish Docs
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : write
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0
23+
24+ - name : Publish to docs branch
25+ run : |
26+ git config user.name "github-actions[bot]"
27+ git config user.email "github-actions[bot]@users.noreply.github.com"
28+
29+ if [ "${{ github.event_name }}" = "release" ]; then
30+ SOURCE="${GITHUB_REF#refs/tags/}"
31+ else
32+ SOURCE="${{ github.event.inputs.source }}"
33+ fi
34+
35+ SOURCE_SHA=$(git rev-parse $SOURCE)
36+ git push -f https://github-actions[bot]:${{ secrets.RELEASE_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "$SOURCE_SHA:refs/heads/docs"
37+ env :
38+ RELEASE_GITHUB_TOKEN : ${{ secrets.RELEASE_GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments