-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs/workflow: Support for deploying branched docs
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.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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 }} | ||
|