-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (41 loc) · 1.44 KB
/
mqtt-publish.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
name: Publish MQTT Images
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
env:
IMAGE_NAME: webui
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platforms::linux/arm/v7,linux/arm64,linux/amd64
echo ::set-output name=docker_username::drakeapps
echo ::set-output name=version::${GITHUB_REF#refs/*/}
echo ::set-output name=hash::${GITHUB_SHA}
- name: Set up buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: GHCR Login
if: success()
env:
CR_PAT: ${{ secrets.CR_PAT }}
run: |
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build mqtt images
if: success() && contains(steps.prepare.outputs.version, 'master')
run: |
cd mqtt-websocket-proxy
docker buildx build \
--output type=image,name=ghcr.io/drakeapps/cloud-led-controller/mqtt,push=true \
--platform ${{ steps.prepare.outputs.docker_platforms }} \
--tag "ghcr.io/drakeapps/cloud-led-controller/mqtt:latest" \
--file Dockerfile .