Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julkue/git-branch-deploy
A Node.js tool to deploy build artifacts to a GitHub branch using a Git commit.
https://github.com/julkue/git-branch-deploy
deploy deploy-tool deployment git travis-ci
Last synced: about 1 month ago
JSON representation
A Node.js tool to deploy build artifacts to a GitHub branch using a Git commit.
- Host: GitHub
- URL: https://github.com/julkue/git-branch-deploy
- Owner: julkue
- License: mit
- Created: 2018-08-01T08:04:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-01T12:59:50.000Z (over 6 years ago)
- Last Synced: 2024-11-21T10:39:22.412Z (2 months ago)
- Topics: deploy, deploy-tool, deployment, git, travis-ci
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git Branch Deploy
A Node.js tool to deploy build artifacts to a GitHub branch using a Git commit.
## Installation
```bash
$ npm i @julmot/git-branch-deploy
```## Deployment
```javascript
const deploy = require('@julmot/git-branch-deploy');deploy({
branch: 'website', // Name of the target branch
sourceDir: `${__dirname}/library/`, // Folder where the build artifacts are located
deployDir: `${__dirname}/deploy/`, // Build folder where the GitHub repository can be cloned to
gitName: process.env.GIT_USER_NAME, // The name that should appear in the Git commit
gitEmail: process.env.GIT_USER_EMAIL, // The e-mail address to use in the Git commit
ghRepository: process.env.GITHUB_REPOSITORY, // The GitHub repository URL, e.g. https://github.com/julmot/git-branch-deploy
ghUser: process.env.GITHUB_USERNAME, // The GitHub username of the account with which the commit should be pushed
ghToken: process.env.GITHUB_TOKEN, // A GitHub private access key of the account with which the commit should be pushed
travis: true // Makes sure the deployment only succeeds when running on Travis CI
});
```The above mentioned values are the default values, except:
* `branch`
* `sourceDir`
* `deployDir`which must be provided (no default values). So, the minimal example would be:
```javascript
deploy({
branch: 'website',
sourceDir: `${__dirname}/library/`,
deployDir: `${__dirname}/deploy/`
});
```__NOTE__: Make sure that the target branch in the repository exists on GitHub. To create an empty branch you can use [these instructions](https://stackoverflow.com/a/13969482/3894981).