-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (76 loc) · 2.29 KB
/
build-release.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 release
on:
workflow_dispatch:
inputs:
releaseType:
description: Release type
required: true
type: choice
options:
- patch
- minor
- major
jobs:
build:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 1.4.0-b${{ github.run_number }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: philipparndt/get-release-number@v2
id: next
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
releaseType: ${{ github.event.inputs.releaseType }}
- name: Update version
working-directory: app
env:
RELEASE_VERSION: ${{ steps.next.outputs.version }}
run: npm version $RELEASE_VERSION --allow-same-version
- name: Install
working-directory: app
shell: bash
run: npm install
- name: Build
working-directory: app
shell: bash
run: npm run build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker container and push
id: docker_build
uses: docker/build-push-action@v4
env:
RELEASE_VERSION: ${{ steps.next.outputs.version }}
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: |
pharndt/hue2mqtt:latest
pharndt/hue2mqtt:${{env.RELEASE_VERSION}}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ steps.next.outputs.version }}
with:
tag_name: ${{env.RELEASE_VERSION}}
release_name: ${{env.RELEASE_VERSION}}
body: |
Docker tag: `pharndt/hue2mqtt:${{env.RELEASE_VERSION}}`
Changes in this Release
- Dependency update
- ...
draft: false
prerelease: false