Skip to content

Commit

Permalink
Add the option to deploy docs to another branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
GGG-KILLER committed Jun 24, 2023
1 parent 8289950 commit b671c82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
target_branch:
type: string
description: The branch the results will be deployed to
default: cf-pages

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -62,11 +67,11 @@ jobs:
!docs/api/index.md
- name: Publish
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: cf-pages
publish_branch: "${{ github.event_name == 'workflow_dispatch' && inputs.target_branch || 'cf-pages' }}"
publish_dir: docs/_site
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
Expand Down

0 comments on commit b671c82

Please sign in to comment.