2020-11-24 06:37:56 +08:00
|
|
|
name: Publish Docker image
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
|
|
|
name: Push Docker image to Docker Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build image
|
|
|
|
run: |
|
|
|
|
docker buildx build --no-cache --push \
|
|
|
|
--tag lolouk44/xiaomi-mi-scale-ha-add-on:${{ github.event.release.tag_name }} \
|
|
|
|
--tag lolouk44/xiaomi-mi-scale-ha-add-on:latest \
|
2020-11-24 07:26:37 +08:00
|
|
|
--file ./mi-scale/Dockerfile \
|
2020-11-24 07:25:00 +08:00
|
|
|
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 .
|
|
|
|
|
|
|
|
- name: Image digest
|
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|