Skip to content

Commit

Permalink
Merge branches 'artwork' and 'documentation'
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Oct 10, 2016
3 parents 2111413 + 53935a2 + deadfcb commit 615ac23
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
67 changes: 65 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,74 @@

* Branch: auto-images

* Directory: `/docs/images`
* Directory: `/docs/images/badges`

## Usage

Use this with CI tools
### Development Environment

#### Building & Testing

##### Setup environment

```bash
npm install && npm install --only=dev
```

##### Building

```bash
npm run build
```

##### Testing

```bash
npm test
```

#### Preview

The following scripts create `/.preview.html` which shows every created artifacts
- `npm run preview`
- `npm run build`
- `npm run test` (or `npm test`)

If `/sh/previewer.sh` is a file, the file will run as a bash script with `$1` is path to `/.preview.html`

### Deployment Environment

#### Branch vs Tag

If you push changes to a branch, CI tools will test only (by `npm test`)

If you push tags, CI tools will do both test and deploy

There're 3 types of releases depend on tag suffix
- `-alpha`: Draft Release
- `-beta`: Prerelease
- no suffix: Official & Stable Release

Deployment is vary, depends on which environment variable is turned on

#### GitHub Release

This type of deployment requires `GITHUB_RELEASE_OAUTH`

#### Gist Repository

This type of deployment requires 3 environment variables
- `RELEASE_GIST` is set to `TRUE`
- `GIST_ID`
- `GIST_TOKEN`

#### GitHub Repository Commit

This type of deployment requires 4 environment variables
- `TARGET_GITHUB_RELEASE_OAUTH` (optional, default to `GITHUB_RELEASE_OAUTH`)
- `TARGET_GITHUB_REPO_OWNER`
- `TARGET_GITHUB_REPO_NAME`
- `TARGET_GITHUB_REPO_BRANCH`

## License

Expand Down
3 changes: 1 addition & 2 deletions deploy/github-target-repo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function * main () {
const parents = [baseCommitSHA]
const {sha: baseTreeSHA, tree: baseTree} = yield github.gitdata.getTree({user, repo, sha: baseCommitSHA})
info('Base Tree SHA', baseTreeSHA)
info({baseTree, baseTreeSHA, baseCommitSHA, baseRefSHA})
info({baseTreeSHA, baseCommitSHA, baseRefSHA})
info(`Reading ${ARTIFACTS_DIRECTORY}`)
const list = readdirSync(ARTIFACTS_DIRECTORY)
.map(
Expand Down Expand Up @@ -120,7 +120,6 @@ function * main () {
({path}) => listpath.every(([diff]) => path !== diff)
)
const resultTree = [...restTree, ...diffTree]
info({listpath, diffTree, restTree, baseTree, resultTree})
const {sha: tree} = yield github.gitdata.createTree({tree: resultTree, base_tree: baseTreeSHA, user, repo})
info('New Tree SHA', tree)
const message = (
Expand Down

0 comments on commit 615ac23

Please sign in to comment.