-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Name | Required? | Default | Example |
---|---|---|---|
hugo_publish_directory | ✅ | 'public' | 'documents' |
source_branch | ✅ | 'main' | |
release_branch | ✅ | 'release' | |
submodule_release_branch | 'main' |
-
release_branch
- Maybe some of you don't want a separate release branch. You can always try using the same value as yoursource_branch
. It might work? I haven't tried it. -
submodule_release_branch
- Only fill this input if yourhugo_publish_directory
contains a git submodule. If this input has a value, the submodule steps will run in the action. Leave it empty if you aren't publishing to a submodule. Those steps will be skipped.
Name | Default | Example |
---|---|---|
hugo_build_options | '-D --minify --ignoreCache' | |
merge_args | '-s recursive -Xtheirs' | '-X Ours' |
full_rebuild | 'false' | |
full_rebuild_verbose | 'false' | |
do_not_delete_regex | '\.txt|^posts$|static.css' | |
commit_message | 'I like big builds, and I cannot lie.' | |
git_config_user | 'Action - Hugo Deploy' | 'aormsby' |
git_config_email | '[email protected]' | '[email protected]' |
strict_build_mode | 'true' | |
tag_release | 'false' | |
test_mode | 'false' |
-
full_rebuild
- This will clean out thehugo_publish_directory
before making a build. Hugo's build option--cleanDestinationDir
deletes everything, but this action'sfull_rebuild
is more specific. It will actually skip over the deletion of files that match the regex pattern you provide indo_not_delete_regex
, so you don't lose important things likeCNAME
files, git configs, or other things that Hugo won't rebuild for you. -
full_rebuild_verbose
- Prints out saved/deleted files during the action run for reference -
do_not_delete_regex
- A custom regex pattern to match files you want to save duringfull_rebuild
. Some files are hardcoded to be saved -"^\.+$|^\.git$|^CNAME$"
, which for sure includes.
,..
,.git
, andCNAME
. You can add your own regex patterns separated by|
(the pipe character) as an input value here. Please be familiar with shell regex before adding your own. (Be careful with the.
character!) -
commit_message
- A default auto-build message is provided as title and description, but you customize the commit title here -
tag_release
- If true, tagged with auto-build number (stored inhugo-deploy.dat
build file) -
strict_build_mode
- If true, Hugo build warning will cause the action to fail. If false, only Hugo errors will cause failure.
Name | Output | Description |
---|---|---|
was_new_build_created | true/false | Outputs true if a new build was made, false if repo is up-to-date and build was skipped. |
The syntax for checking outputs in workflows is very specific. If you have syntax problems, your output checks won't work as expected. Please note the different ways to access and compare output values in these samples--
- name: Was a new build made?
if: steps.build.outputs.was_new_build_created == 'true'
run: echo "YAASSSS new build."
if: steps.build.outputs.was_new_build_created == 'false'
run: echo "NOOOOOOO new build."
New outputs can be added on request. Please open an issue describing your needs, and we can work out a good solution.
v1 | v2 |
---|---|
deploy_directory | hugo_publish_directory |
build_branch | source_branch |
X | release_branch |
deploy_branch | submodule_release_branch |
fresh_build | full_rebuild |
do_not_delete_files | do_not_delete_regex |
git_user | git_config_user |
git_email | git_config_email |
The only major setup note I have right now is that you *must use fetch-depth:0
in your checkout step. I'm currently having trouble managing shallow repo clones within the action, and if you don't have a deep enough clone of the repo you will encounter unexpected problems in your build (such as earlier commits not being accounted for in the merge step to the release branch).
--
If you encounter any other setup problems or anything confusing, please open an issue and I can add more info here as needed. Thanks!