Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions workflow #1012

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---

name: Docker image build

on:
push:
paths:
- 'Dockerfile'
- 'version.json'
branches: ['master']
workflow_dispatch:
pull_request:
paths:
- 'Dockerfile'
- 'version.json'

jobs:
docker-build:
runs-on: ubuntu-latest
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
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'version.json'
prop_path: 'version'

- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./
file: Dockerfile
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
build-args: |
VERSION=${{ steps.version.outputs.prop }}
CHANNEL=${{ steps.channel.outputs.prop }}
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ secrets.DOCKER_HUB_USER }}/tuya-convert:latest
${{ secrets.DOCKER_HUB_USER }}/tuya-convert:${{ steps.version.outputs.prop }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.revision=${{ github.sha }}
3 changes: 3 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "2.4.5"
}