generated from Apodini/Template-Repository
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.46 KB
/
docker.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
#
# This source file is part of the Collector-Analyst-Presenter Example open source project
#
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
#
# SPDX-License-Identifier: MIT
#
name: Build Docker Image
on:
release:
types: [published]
workflow_dispatch:
jobs:
docker:
name: Docker Build and Push Image
runs-on: ubuntu-latest
strategy:
matrix:
webservice: [Gateway, Database, Processing]
steps:
- id: webservice
uses: ASzc/change-string-case-action@v2
with:
string: ${{ matrix.webservice }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest tag
id: latesttag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: latest
- name: Log in to the container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker imag
uses: docker/build-push-action@v2
with:
context: ./${{ matrix.webservice }}
push: true
tags: ghcr.io/apodini/collectoranalystpresenterexample/${{ steps.webservice.outputs.lowercase }}:latest,ghcr.io/apodini/collectoranalystpresenterexample/${{ steps.webservice.outputs.lowercase }}:${{ steps.latesttag.outputs.tag }}