Skip to content

Commit

Permalink
Merge pull request #25 from brian-rose/add-cname
Browse files Browse the repository at this point in the history
Add optional cname argument for deploy
  • Loading branch information
brian-rose authored Nov 14, 2022
2 parents 5c8d125 + 1063e21 commit b676947
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/deploy-book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
default: 'false'
type: string
cname:
description: 'Custom domain name'
required: false
default: 'None' # This is just a flag for whether to ignore this input
type: string

jobs:
deploy:
Expand Down Expand Up @@ -51,10 +56,25 @@ jobs:
- name: Deploy to GitHub Pages
uses: peaceiris/[email protected]
if: github.ref == 'refs/heads/main'
if: |
(github.ref == 'refs/heads/main'
&& inputs.cname == 'None')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
enable_jekyll: false
keep_files: true # This preserves existing previews from open PRs
destination_dir: ${{ inputs.destination_dir }}

- name: Deploy to GitHub Pages with custom domain
uses: peaceiris/[email protected]
if: |
(github.ref == 'refs/heads/main'
&& inputs.cname != 'None')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
enable_jekyll: false
keep_files: true # This preserves existing previews from open PRs
destination_dir: ${{ inputs.destination_dir }}
cname: ${{ inputs.cname }}

0 comments on commit b676947

Please sign in to comment.