Skip to content

Commit

Permalink
docs/workflow: Support for deploying branched docs
Browse files Browse the repository at this point in the history
Add the word(s): deploy-docs to any commit message to deploy a variation
of docs under gh-pages/branch/<branchname>

Signed-off-by: Gunnar Andersson <gunnar@[email protected]>
  • Loading branch information
Gunnar Andersson committed Apr 14, 2023
1 parent 5471ec6 commit 3ee185c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.10.10
python-version: 3.10.x

- name: Install tools
run: |
Expand All @@ -34,12 +34,25 @@ jobs:
echo "Docs to deploy:"
ls -al docs
- name: Deploy docs
- name: Deploy master docs
# Only deploy docs if this was a push to master
#if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: JamesIves/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
commit-message: Auto-deploy docs built from commit ${{ github.sha }}

- name: Deploy branched docs
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/master' &&
contains(github.event.head_commit.message, 'deploy-docs') }}
# Use modified deployment if this was NOT a push to master
uses: JamesIves/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
target-folder: branch/${{github.ref_name}}
commit-message: Auto-deploy docs built from commit ${{ github.sha }}

0 comments on commit 3ee185c

Please sign in to comment.