Skip to content

Commit a829861

Browse files
committed
Automatically build image on release
1 parent 7b682f7 commit a829861

File tree

2 files changed

+64
-6
lines changed

2 files changed

+64
-6
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Publish Docker image
7+
8+
on:
9+
release:
10+
types: [published]
11+
12+
jobs:
13+
push_to_registries:
14+
name: Push Docker image to multiple registries
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
contents: read
19+
steps:
20+
- name: Check out the repo
21+
uses: actions/checkout@v2
22+
23+
- name: Push README to Dockerhub
24+
uses: christian-korneck/update-container-description-action@v1
25+
env:
26+
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
27+
DOCKER_PASS: ${{ secrets.DOCKERHUB_PWD }}
28+
with:
29+
destination_container_repo: tekgator/docker-mcmyadmin
30+
provider: dockerhub
31+
short_description: 'Readme'
32+
readme_file: 'README.md'
33+
34+
- name: Log in to Docker Hub
35+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
36+
with:
37+
username: ${{ secrets.DOCKERHUB_USERNAME }}
38+
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
40+
- name: Log in to the Container registry
41+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GHCR_PAT }}
46+
47+
- name: Extract metadata (tags, labels) for Docker
48+
id: meta
49+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
50+
with:
51+
images: |
52+
tekgator/docker-mcmyadmin
53+
ghcr.io/${{ github.repository }}
54+
55+
- name: Build and push Docker images
56+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
57+
with:
58+
context: .
59+
push: true
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# docker-hd-idle
22

33
<p>
4-
<a href="https://hub.docker.com/r/tekgator/docker-hd-idle/tags?page=1&ordering=last_updated" alt="DockerBuildStatus">
5-
<img src="https://img.shields.io/docker/cloud/build/tekgator/docker-hd-idle" />
4+
<a href="https://github.com/tekgator/docker-hd-idle/actions/workflows/build-and-publish.yml" alt="BuildStatus">
5+
<img src="https://img.shields.io/github/workflow/status/tekgator/docker-hd-idle/Publish%20Docker%20image" />
66
</a>
77
<a href="https://hub.docker.com/r/tekgator/docker-hd-idle" alt="DockerPulls">
88
<img src="https://img.shields.io/docker/pulls/tekgator/docker-hd-idle" />
99
</a>
10-
<a href="https://hub.docker.com/r/tekgator/docker-hd-idle/tags?page=1&ordering=last_updated" alt="DockerBuilds">
11-
<img src="https://img.shields.io/docker/cloud/automated/tekgator/docker-hd-idle" />
12-
</a>
1310
<a href="https://hub.docker.com/r/tekgator/docker-hd-idle/tags?page=1&ordering=last_updated" alt="DockerBuildStatus">
1411
<img src="https://img.shields.io/docker/image-size/tekgator/docker-hd-idle/latest" />
1512
</a>
@@ -51,7 +48,7 @@ Many thanks to to both of them for this great tool!
5148

5249
## Supported tags and respective `Dockerfile` links
5350

54-
* [`1.2.0`, `latest`](https://github.com/tekgator/docker-hd-idle/blob/main/Dockerfile): Golang version 1.13 and legacy version 1.05
51+
* [`1.2.1`, `latest`](https://github.com/tekgator/docker-hd-idle/blob/main/Dockerfile): Golang version 1.13 and legacy version 1.05
5552

5653
* [`dev`](https://github.com/tekgator/docker-hd-idle/blob/main/Dockerfile): Development build
5754

0 commit comments

Comments
 (0)