-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (102 loc) · 3.02 KB
/
docker-publish-latest.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: publish latest image docker
on:
push:
branches:
- main
jobs:
client-build:
if: github.repository_owner == 'shadrqen'
runs-on: ubuntu-latest
defaults:
run:
# Clientside folder working directory.
working-directory: ./client
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: | # to build only on changes to the clientside
client:
- 'client/**'
- name: Check out the repo
uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%s')"
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: ./client
file: ./client/Dockerfile
push: true
tags: ${{ secrets.ES_CLIENT }}:latest
server-build:
if: github.repository_owner == 'shadrqen'
runs-on: ubuntu-latest
defaults:
run:
# Serverside folder working directory.
working-directory: ./server
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: | # to build only on changes to the serverside
server:
- 'server/**'
- name: Check out the repo
uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%s')"
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: ./server
file: ./server/Dockerfile
push: true
tags: ${{ secrets.ES_SERVER }}:latest
dbms-build:
if: github.repository_owner == 'shadrqen'
runs-on: ubuntu-latest
defaults:
run:
# DBMS folder working directory.
working-directory: ./dbms
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: | # to build only on changes to the dbms
dbms:
- 'dbms/**'
- name: Check out the repo
uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%s')"
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: ./dbms
file: ./dbms/Dockerfile
push: true
tags: ${{ secrets.ES_DBMS }}:latest