Cleanly push directory contents to a branch. Particularly useful for gh-pages deployment.
steps:
- uses: actions/checkout@v3
- run: build_site_command --output-dir static_site
- uses: casperdcl/push-dir@v1
with:
message: update static site
branch: gh-pages
dir: static_site
history: false
cname: my.domain.com
nojekyll: truePerfect for e.g. gh-pages deployment.
- Supports pushing the contents of a directory to a branch
- Supports discarding branch history
- Uses a blazing fast native GitHub composite action
- Has the entirety of the code in a single file, making it very easy to review
- If you are extremely security conscious you can use a commit SHA of a version you've manually reviewed (e.g.
uses: casperdcl/push-dir@67a9d1d)
- If you are extremely security conscious you can use a commit SHA of a version you've manually reviewed (e.g.
The main alternatives GitHub Actions gh-pages-deploy and github-push currently do not offer the benefits above.
Other features (supported by some of the alternatives) include:
- Custom committer name & email
- Custom commit message
- Force pushing
CNAME&.nojekyllconveniences for GitHub pages
message:
description: Commit message
required: true
branch:
description: Branch to push to
required: true
dir:
description: Directory to push
default: .
required: false
force:
description: Set to "true" to force push
required: false
history:
description: |
Set to "false" to discard any prior commits on the `branch`
(Note: "false" will override `force` to "true")
default: true
required: false
cname:
description: Text to inject into a `CNAME` file
default: ''
required: false
nojekyll:
description: Set to "true" to add a `.nojekyll` file
required: false
name:
description: Git committer name
required: false
email:
description: Git committer email
required: false