-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.74 KB
/
docker.yml
File metadata and controls
80 lines (67 loc) · 2.74 KB
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
name: Build Docker CLI
on:
pull_request:
branches: 'master'
paths:
- '.github/workflows/*'
- 'Dockerfile**'
- 'src/**'
push:
branches: 'master'
tags: 'v*'
paths:
- '.github/workflows/*'
- 'Dockerfile**'
- 'src/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Login to github registry
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Prepare
id: prepare
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
else
echo ::set-output name=version::snapshot
fi
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=docker_image::seanonet/roomtempdashboard
- name: Build
if: success()
run: docker build -f Dockerfile .
- name: Build arm32
if: success()
run: docker build -f Dockerfile.debian-arm32 .
- name: Build With Tag
if: success() && startsWith(github.ref, 'refs/tags/v')
run: docker build -t "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" -t "${{ steps.prepare.outputs.docker_image }}:latest" -f Dockerfile .
- name: Build arm32 With Tag
if: success() && startsWith(github.ref, 'refs/tags/v')
run: docker build -t "${{ steps.prepare.outputs.docker_image }}:linux-arm-${{ steps.prepare.outputs.version }}" -t "${{ steps.prepare.outputs.docker_image }}:linux-arm-latest" -f Dockerfile.debian-arm32 .
- name: Push latest image
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: actions-hub/docker@master
with:
args: push "${{ steps.prepare.outputs.docker_image }}:latest"
- name: Push latest version image
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: actions-hub/docker@master
with:
args: push "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}"
- name: Push latest arm image
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: actions-hub/docker@master
with:
args: push "${{ steps.prepare.outputs.docker_image }}:linux-arm-latest"
- name: Push latest arm version image
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: actions-hub/docker@master
with:
args: push "${{ steps.prepare.outputs.docker_image }}:linux-arm-${{ steps.prepare.outputs.version }}"