-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (49 loc) · 1.66 KB
/
build-and-publish-docker-images-workflow.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
name: Build-and-publish-docker-images-workflow
on:
push:
branches:
- main
- staging
- development
release:
types: [published]
jobs:
Build-and-publish-docker-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set environment for branch
run: |
if [[ "${{github.base_ref}}" == "main" || "${{github.ref}}" == "refs/heads/main" ]]; then
echo "IMAGE_TAG=latest" >> "$GITHUB_ENV"
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "IMAGE_TAG=staging" >> "$GITHUB_ENV"
else
echo "IMAGE_TAG=unstable" >> "$GITHUB_ENV"
fi
- name: Build and push All in One image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
context: .
push: true
tags: fraunhoferiosb/aasportal_aio:${{env.IMAGE_TAG}}
- name: Build and push AASPortal (frontend) image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.aas-portal
context: .
push: true
tags: fraunhoferiosb/aasportal_aasportal:${{env.IMAGE_TAG}}
- name: Build and push AASServer (backend) image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.aas-server
context: .
push: true
tags: fraunhoferiosb/aasportal_aasserver:${{env.IMAGE_TAG}}