Skip to content

Commit 9dbf308

Browse files
authored
Add Docker Hub publish action (#73)
* chore: add build and docker badges to readme * chore: add .dockerignore * ci: add docker hub image publish workflow
1 parent d723283 commit 9dbf308

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
__pycache__
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.Python
6+
env
7+
pip-log.txt
8+
.git
9+
.DS_Store
10+
README.md
11+
Dockerfile

.github/workflows/docker.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
push_to_registry:
14+
name: Push Docker image to Docker Hub
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out the repo
18+
uses: actions/checkout@v2
19+
20+
- name: Log in to Docker Hub
21+
uses: docker/login-action@v1
22+
with:
23+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
24+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
25+
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@v3
29+
with:
30+
images: bchew/dynamodump
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v2
34+
with:
35+
context: .
36+
push: true
37+
tags: ${{ steps.meta.outputs.tags }}
38+
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# dynamodump
22

33
[![PyPI version](https://badge.fury.io/py/dynamodump.svg)](https://badge.fury.io/py/dynamodump)
4+
[![Docker](https://img.shields.io/docker/cloud/build/bchew/dynamodump?label=Docker&style=flat)](https://hub.docker.com/r/bchew/dynamodump/builds)
5+
![Build Status](https://github.com/bchew/dynamodump/workflows/build/badge.svg)
46
![Linting Status](https://github.com/bchew/dynamodump/workflows/Linting/badge.svg)
57
![Test Status](https://github.com/bchew/dynamodump/workflows/Test/badge.svg)
68

0 commit comments

Comments
 (0)