https://github.com/tagus/git-deploy
Commit and push changes to a target git repo.
https://github.com/tagus/git-deploy
git github-actions shell
Last synced: 5 months ago
JSON representation
Commit and push changes to a target git repo.
- Host: GitHub
- URL: https://github.com/tagus/git-deploy
- Owner: tagus
- License: mit
- Created: 2020-04-21T02:38:34.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-06-10T21:41:26.000Z (about 3 years ago)
- Last Synced: 2025-10-12T23:33:04.866Z (8 months ago)
- Topics: git, github-actions, shell
- Language: Shell
- Size: 35.2 KB
- Stars: 10
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git Deploy Github Action

This action takes a directory, copies it over to an existing repo, and deploys (pushes) the repo
with the committed changes. This action was written to support a workflow for deploying changes
to a github pages repo from another repo that contains the source files.
Note that the commit message for each deployment is statically defined as the following:
```
auto-update -
```
## Inputs
### `repository`
**Required** The SSH url of the target repository.
### `changes`
**Required** The path to the directory containing the changes to deploy. Since
the current workspace will be mounted as the action root. A relative path is all
you need for `git-deploy` to pick up the `changed` directory.
### `ssh_key`
**Required** The SSH key used to push to the registry. The SSH key is
configured with the local git config, enabling this action to run
authenticated git commands.
Follow [these](https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys)
instructions to create and integrate a deploy key with the target repo.
### `ssh_known_hosts`
The known hosts to run SSH commands against. By default, `github.com` is used
as the known host.
### `name`
**Required** A name for the git user create the git commit.
### `email`
**Required** An email for the git user creating the git commit.
### `branch`
The branch name of the remote repo to push to. By default, `main` is used.
Note that this branch must already exist in the remote repo.
### `message`
The commit message used for the commit. By default, a standard format is used
e.g. `auto-deploy: 2020-10-03 16:54:59`.
### `clean_repo`
A boolean that specifies whether to remove all files in repository that are not present
in the specified `changes` directory.
## Example Usage
```yaml
name: deploy changes to a repo
uses: tagus/git-deploy@v0.5.0
with:
changes: public
repository: git@github.com:/.git
ssh_key: ${{ secrets.REPO_DEPLOY_KEY }}
name: user
email: user@email.com
clean_repo: true
```