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 }}
0 commit comments