-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (71 loc) · 2.64 KB
/
docker-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build and Push Image
on:
push:
paths:
- 'docker/**'
# release:
# types: [released]
jobs:
build:
name: Build and push image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build Image of PostgreSQL-Backup-Zen
id: build-image-pg
uses: redhat-actions/buildah-build@v2
with:
image: rezachalak/bzen-pg
context: ./docker/pg
tags: latest ${{ github.sha }} ${{ github.event.release.tag_name }}
dockerfiles: |
./docker/pg/Dockerfile
- name: Build Image of MongoDB-Backup-Zen
id: build-image-mongo
uses: redhat-actions/buildah-build@v2
with:
image: rezachalak/bzen-mongo
context: ./docker/mongo
tags: latest ${{ github.sha }} ${{ github.event.release.tag_name }}
dockerfiles: |
./docker/mongo/Dockerfile
- name: Build Image of MySQL-Backup-Zen
id: build-image-mysql
uses: redhat-actions/buildah-build@v2
with:
image: rezachalak/bzen-mysql
context: ./docker/mysql
tags: latest ${{ github.sha }} ${{ github.event.release.tag_name }}
dockerfiles: |
./docker/mysql/Dockerfile
# Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in,
# in which case 'username' and 'password' can be omitted.
- name: Push To dhub
id: push-to-dhub-pg
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image-pg.outputs.image }}
tags: ${{ steps.build-image-pg.outputs.tags }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push To dhub
id: push-to-dhub-mongo
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image-mongo.outputs.image }}
tags: ${{ steps.build-image-mongo.outputs.tags }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push To dhub
id: push-to-dhub-mysql
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image-mysql.outputs.image }}
tags: ${{ steps.build-image-mysql.outputs.tags }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Print image url
run: echo "Images pushed to ${{ steps.push-to-dhub-pg.outputs.registry-paths }} /n/n/n ${{ steps.push-to-dhub-mongo.outputs.registry-paths }} /n/n/n ${{ steps.push-to-dhub-mysql.outputs.registry-paths }}"