-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from brian-rose/add-cname
Add optional cname argument for deploy
- Loading branch information
Showing
1 changed file
with
21 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -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: | ||
|
@@ -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 }} |