-
Notifications
You must be signed in to change notification settings - Fork 174
46 lines (44 loc) · 1.67 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
name: docker build
on:
push:
branches: [ master ]
tags:
- '*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
sudo apt install -yq python3-pip
python3 -m pip install setuptools_scm
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker image
run: |
./dockerfiles/build.sh
docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
docker-compose -f dockerfiles/staging/docker-compose.yml down
docker images
- name: Tag latest images
run: |
docker tag labgrid-client ${{ secrets.DOCKERHUB_PREFIX }}client
docker tag labgrid-exporter ${{ secrets.DOCKERHUB_PREFIX }}exporter
docker tag labgrid-coordinator ${{ secrets.DOCKERHUB_PREFIX }}coordinator
- name: Tag release image
if: startsWith(github.ref, 'refs/tags')
run: |
docker tag labgrid-client ${{ secrets.DOCKERHUB_PREFIX }}client:${GITHUB_REF_NAME}
docker tag labgrid-exporter ${{ secrets.DOCKERHUB_PREFIX }}exporter:${GITHUB_REF_NAME}
docker tag labgrid-coordinator ${{ secrets.DOCKERHUB_PREFIX }}coordinator:${GITHUB_REF_NAME}
- name: Push to dockerhub
run: |
docker push --all-tags ${{ secrets.DOCKERHUB_PREFIX }}client
docker push --all-tags ${{ secrets.DOCKERHUB_PREFIX }}exporter
docker push --all-tags ${{ secrets.DOCKERHUB_PREFIX }}coordinator
- name: Show images again
run: docker images