Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/actions-hub/docker
GitHub Action with docker cli
https://github.com/actions-hub/docker
action cli docker github-actions
Last synced: about 2 months ago
JSON representation
GitHub Action with docker cli
- Host: GitHub
- URL: https://github.com/actions-hub/docker
- Owner: actions-hub
- License: mit
- Created: 2019-10-25T19:19:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-07T17:56:27.000Z (over 2 years ago)
- Last Synced: 2024-10-07T02:06:17.040Z (3 months ago)
- Topics: action, cli, docker, github-actions
- Language: Shell
- Homepage: https://github.com/marketplace/actions/the-docker-cli
- Size: 15.6 KB
- Stars: 23
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker
[![Docker](https://serhiy.s3.eu-central-1.amazonaws.com/Github_repo/docker/horizontal-logo-monochromatic-white.png)](https://www.docker.com)
GitHub Action with docker cli.
## Usage
```bash
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}- name: Build :latest
run: docker build -t ${GITHUB_REPOSITORY}:latest .- name: Push to docker hub :latest
uses: actions-hub/docker@master
with:
args: push ${GITHUB_REPOSITORY}:latest
```## Actions
This repository contains 2 actions:
- [login](https://github.com/actions-hub/docker/tree/master/login)
- [cli](https://github.com/actions-hub/docker/tree/master/cli)## Example
### Latest
```bash
name: Docker registryon: [push]
jobs:
github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1- name: Login to github registry
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY_URL: docker.pkg.github.com- name: Build :latest
if: success()
run: docker build -t docker.pkg.github.com/${{ github.repository }}/app:latest .
- name: Push to docker hub :latest
if: success()
uses: actions-hub/docker@master
with:
args: push docker.pkg.github.com/${{ github.repository }}:latest
```### Tag
```bash
name: Docker registryon:
push:
tags:
- 'v*'jobs:
github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1- name: Login to github registry
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY_URL: docker.pkg.github.com- name: Build :tag
if: success()
run: docker build -t docker.pkg.github.com/${{ github.repository }}/app:${IMAGE_TAG} .- name: Push to docker hub :tag
if: success()
uses: actions-hub/docker@master
with:
args: push docker.pkg.github.com/${{ github.repository }}:${IMAGE_TAG}
```### Universal
```bash
name: Deploy to docker hubon:
push:
branches:
- master
tags:
- 'v*'jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master- name: Login to docker hub
if: success()
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}- name: Build image
if: success()
run: docker build -t ${GITHUB_REPOSITORY}:${IMAGE_TAG} .- name: Push to docker registry
if: success()
uses: actions-hub/docker@master
with:
args: push ${GITHUB_REPOSITORY}:${IMAGE_TAG}
```### CLI
```bash
name: Run docker CLIon:
push:
branches:
- masterjobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@master- name: Use Docker
uses: actions-hub/docker/cli@master
env:
SKIP_LOGIN: true- run: docker --version
```## Licence
[MIT License](https://github.com/actions-hub/docker/blob/master/LICENSE)