Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-smithers-excellent committed Oct 17, 2019
0 parents commit ab0db2b
Show file tree
Hide file tree
Showing 13 changed files with 6,492 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": [
"airbnb",
"prettier"
],
"env": {
"es6": true,
"node": true,
"jest": true
},
"rules": {
"prettier/prettier": [
"error",
{
"trailingComma": "none",
"singleQuote": true,
"printWidth": 120
}
]
},
"plugins": [
"prettier"
]
}
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'CI Pipeline'

on:
pull_request:
push:
branches:
- master

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: npm ci
- run: npm test
68 changes: 68 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# comment this out distribution branches
node_modules/

# Editors
.vscode
.idea

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Other Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Sean Smith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Docker Build & Push Action
<p align="center">
<a href="https://github.com/mr-smithers-excellent/docker-build-push-action"><img alt="GitHub Actions status" src="https://github.com/mr-smithers-excellent/docker-build-push-action/workflows/test-local/badge.svg"></a>
</p>

Builds a Docker image using a `Dockerfile` in the root project directory and pushes the resulting Docker image to the private registry of your choosing.

## Requirements

* [GitHub Actions Beta](https://github.com/features/actions) program participation
* Run [checkout action](https://github.com/actions/checkout) before using this action
```yaml
steps:
- uses: actions/checkout@v1
```
## Inputs
| Name | Description |
|------|-------------|
## Examples
### Docker Hub
```yaml
uses: mr-smithers-excellent/docker-build-push-action@master
with:
image: docker-hub-repo/image-name
registry: docker.io
username: your-username
password: ${{ secrets.password }}
```
### Google Container Registry (GCR)
```yaml
uses: mr-smithers-excellent/docker-build-push-action@master
with:
image: gcp-project/image-name
registry: https://gcr.io
username: _json_key
password: ${{ secrets.password }}
```
## Tagging the image using GitOps
By default, this action will use an algorithm based on the state of your git repo to determine the Docker image tag. This is designed to enable develops to more easily use [GitOps](https://dzone.com/articles/what-is-gitops-really) in their CI/CD pipelines.
27 changes: 27 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Docker Build & Push'
description: 'Builds a Docker image and pushes to a private registry'
inputs:
image:
description: 'Name of the Docker image'
required: true
tag:
description: 'Tag override for Docker image'
required: false
registry:
description: 'Target Docker registry'
required: true
username:
description: 'Docker registry username'
required: true
password:
description: 'Docker registry password'
required: true
outputs:
imageFullName:
description: 'Full name of the Docker image'
runs:
using: 'node12'
main: 'dist/index.js'
branding:
icon: 'codesandbox'
color: 'black'
Loading

0 comments on commit ab0db2b

Please sign in to comment.