forked from signum-network/signum-node
83 lines (74 loc) · 2.43 KB
/
dockerhub.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
82
83
# This workflow uses secrets stored in a specific github environment called `dockerhub-publish`.
# It needs to be created in repository settings->environments
# Add the dockerhub username and password in secrets named:
# DOCKERHUB_USERNAME
# DOCKERHUB_PASSWORD
# Add the dockerhub repo path in a secret named:
# DOCKERHUB_REPO
# This workflow will use them automatically.
name: Publish Docker image
on:
release:
types: [released]
workflow_dispatch:
jobs:
publish-h2-image:
environment: dockerhub-publish
name: Push h2 db Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ secrets.DOCKERHUB_REPO }}
tags: |
type=semver,pattern={{version}}-h2
type=raw,value=latest-h2
flavor: |
latest=false
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
file: 'Dockerfile.h2'
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
publish-maria-image:
environment: dockerhub-publish
name: Push mariadb Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ secrets.DOCKERHUB_REPO }}
tags: |
type=semver,pattern={{version}}-maria
type=raw,value=latest-maria
flavor: |
latest=false
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
file: 'Dockerfile.mariadb'
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}