A CI/CD plugin for Drone, Woodpecker, and GitHub Actions to push changes to a remote Git repository.
- Push commits to remote repositories via SSH or HTTPS
- Mirror all refs to a remote repository
- Auto-commit dirty changes before pushing
- Tag support with follow-tags option
- Rebase before push
- Force push support
- Custom commit messages
- Empty commit support
- Git LFS support
| CI Platform | Status |
|---|---|
| Drone | Fully supported |
| Woodpecker | Fully supported |
| GitHub Actions | Fully supported |
Basic push to a remote branch:
- name: push commit
image: appleboy/drone-git-push
settings:
branch: master
remote: git@github.com:foo/bar.git
ssh_key:
from_secret: deploy_keyPush with commit changes:
- name: push commit
image: appleboy/drone-git-push
settings:
branch: master
remote: git@github.com:foo/bar.git
force: false
commit: true
commit_message: "[skip ci] Update generated files"
ssh_key:
from_secret: deploy_keyPush to the current repository:
- name: push commit
image: appleboy/drone-git-push
settings:
remote_name: origin
branch: gh-pages
local_ref: gh-pagesMirror all refs to a remote repository:
- name: mirror push
image: appleboy/drone-git-push
settings:
remote: git@github.com:foo/bar-mirror.git
mirror: true
ssh_key:
from_secret: deploy_keyPush with tagging:
- name: push with tag
image: appleboy/drone-git-push
settings:
branch: master
remote: git@github.com:foo/bar.git
commit: true
tag: v1.0.0
followtags: true
ssh_key:
from_secret: deploy_key- name: Push changes
uses: appleboy/drone-git-push@master
with:
remote: git@github.com:foo/bar.git
branch: master
ssh_key: ${{ secrets.DEPLOY_KEY }}| Parameter | Description | Default |
|---|---|---|
ssh_key |
Private SSH key for the remote machine | - |
remote |
Target remote repository URL | - |
remote_name |
Name of the remote to use locally | deploy |
branch |
Target remote branch | master |
local_branch |
Local branch or ref to push | HEAD |
path |
Path to git repository | Current directory |
force |
Force push using --force flag |
false |
skip_verify |
Skip verification of HTTPS certs | false |
commit |
Add and commit the contents before pushing | false |
commit_message |
Custom commit message | [skip ci] Commit dirty state |
empty_commit |
Create an empty commit | false |
no_verify |
Bypass pre-commit and commit-msg hooks | false |
tag |
Tag to add to the commit | - |
followtags |
Push with --follow-tags option |
false |
rebase |
Pull --rebase before pushing |
false |
mirror |
Push all refs with --mirror |
false |
author_name |
Author name for the commit | CI commit author |
author_email |
Author email for the commit | CI commit author email |
Provide a private SSH key for authentication:
settings:
ssh_key:
from_secret: deploy_keyUse netrc credentials for HTTPS authentication:
settings:
username:
from_secret: git_username
password:
from_secret: git_passwordBuild the binary:
go build
go testBuild Docker image:
# Build for Linux amd64
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-git-push
# Build Docker image
docker build --rm -t appleboy/drone-git-push -f docker/Dockerfile .docker run --rm \
-e DRONE_COMMIT_AUTHOR=Octocat \
-e DRONE_COMMIT_AUTHOR_EMAIL=octocat@github.com \
-e PLUGIN_SSH_KEY="$(cat "${HOME}/.ssh/id_rsa")" \
-e PLUGIN_BRANCH=master \
-e PLUGIN_REMOTE=git@github.com:foo/bar.git \
-e PLUGIN_FORCE=false \
-v "$(pwd):$(pwd)" \
-w "$(pwd)" \
appleboy/drone-git-pushMIT License - see the LICENSE file for details.