Skip to content

PUBLISH

PUBLISH #21

Workflow file for this run

name: "PUBLISH"
on:
workflow_dispatch:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
workflow_run:
workflows: ["CICD"]
types:
- completed
branches:
- 'main'
jobs:
publish:
runs-on: self-hosted
environment: prod
steps:
- name: "Checkout code"
uses: actions/checkout@v3
- name: "Delete old images"
run: docker rmi -f miiocli; exit 0
- name: "Login to docker hub"
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: "Install buildx"
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
- name: "Build and push the image"
run: |
docker buildx build --push \
--tag clickbg/miiocli:latest \
--tag clickbg/miiocli:stable \
--platform linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64 .