Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions github-actions/static-websites/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: 'AWS IAM credentials used to invalidate Cloudfront'
required: false
default: ''
custom_domain:
description: 'The custom domain for GitHub Pages'
required: false
default: ''

runs:
using: docker
Expand Down
7 changes: 7 additions & 0 deletions github-actions/static-websites/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ IFS=$'\n\t'
deploy_dir="${GITHUB_WORKSPACE}/${INPUT_DEPLOY_DIR}"
github_token="${INPUT_GITHUB_TOKEN}"
cloudfront_distribution="${INPUT_CLOUDFRONT_DISTRIBUTION-}"
custom_domain="${CUSTOM_DOMAIN-}"

export AWS_ACCESS_KEY_ID="${INPUT_AWS_ACCESS_KEY_ID-}"
export AWS_SECRET_ACCESS_KEY="${INPUT_AWS_SECRET_ACCESS_KEY-}"
Expand All @@ -16,6 +17,12 @@ touch "${deploy_dir}/.nojekyll"

# Push the website to GitHub pages
cd "${deploy_dir}"

# Set custom domain if present.
if [[ -n "${custom_domain}" ]]; then
echo "${custom_domain}" > ./CNAME
fi

rm -rf .git
git init
git config user.name "Deploy from CI"
Expand Down