-
Notifications
You must be signed in to change notification settings - Fork 34
90 lines (80 loc) · 2.62 KB
/
main.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
---
name: Build and push image
on:
push:
paths:
- 'docker/**'
- 'version.json'
branches: ['main']
pull_request:
paths:
- 'docker/**'
- 'version.json'
workflow_dispatch:
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: standard
dockerfile: docker/Dockerfile
platforms: |-
linux/amd64
linux/arm/v7
linux/arm64
image_name: "docker-deconz"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'version.json'
prop_path: 'version'
- name: get channel
id: channel
uses: notiz-dev/github-action-json-property@release
with:
path: 'version.json'
prop_path: 'channel'
- name: Build and push ${{ matrix.name }}
uses: docker/build-push-action@v2
with:
context: ./docker/
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
build-args: |
VERSION=${{ steps.version.outputs.prop }}
CHANNEL=${{ steps.channel.outputs.prop }}
push: ${{ github.event_name != 'pull_request' }}
provenance: false
tags: |
deconzcommunity/deconz:latest
deconzcommunity/deconz:${{ steps.version.outputs.prop }}
deconzcommunity/deconz:${{ steps.channel.outputs.prop }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.prop }}
ghcr.io/${{ github.repository }}:${{ steps.channel.outputs.prop }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.revision=${{ github.sha }}