Skip to content

Commit

Permalink
🌟 feat: tag docker image (#3)
Browse files Browse the repository at this point in the history
* initial test

* commit node_modules

* fix file path

* add pull tag

* fix error

* fix sequence

* refactor name

* add error image

* add todo

* update README

* PR comment
  • Loading branch information
nandiheath authored Mar 1, 2021
1 parent 2236580 commit b161175
Show file tree
Hide file tree
Showing 41 changed files with 2,465 additions and 0 deletions.
95 changes: 95 additions & 0 deletions tag-docker-image/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
node_modules
lib

# Jetbrains
/.idea
/*.iml

# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://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

# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# 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
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/
45 changes: 45 additions & 0 deletions tag-docker-image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Docker Tag

Github action for tagging an existing docker image and push it without rebuild. This can enhance your workflow since [build-push-action](https://github.com/docker/build-push-action) would require a rebuild when you tag it, while we would want to reuse the same image built for the same commit.

## Usage

You MUST login with `docker/login-action@v1` to create the credentials in order to use this action.

### Parameters

| parameter | description | required |
| --------- | ------------------------ | -------- |
| from_tag | The image to pull | true |
| to_tag | The new tag of the image | true |

### Example

```yaml
name: ci

on:
push:
branches:
- 'master'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Tag Image
uses: kintoproj/kinto-github-actions/[email protected]
with:
from_tag: kintoproj/test:${{ github.sha }}
to_tag: kintoproj/test:v1.0.0
```
2 changes: 2 additions & 0 deletions tag-docker-image/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- switch to typescript
- unit tests
19 changes: 19 additions & 0 deletions tag-docker-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: kinto-github-actions/tag-docker-image
description: Tagging an existing docker image and push it without rebuild.
author: nandiheath
branding:
icon: upload-cloud
color: blue
inputs:
to_tag:
description: The name of the tag you would push to.
required: true
from_tag:
description: The name of the tag image originated.
required: true

runs:
using: 'node12'
main: 'src/index.js'
post: 'src/index.js'

22 changes: 22 additions & 0 deletions tag-docker-image/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tag-docker-image/node_modules/@actions/core/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

147 changes: 147 additions & 0 deletions tag-docker-image/node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tag-docker-image/node_modules/@actions/core/lib/command.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b161175

Please sign in to comment.