Skip to content

Merge branch 'develop' #5

Merge branch 'develop'

Merge branch 'develop' #5

Workflow file for this run

name: Docker Publish Latest
on:
push:
# Publish `main` as Docker `latest` image.
# branches:
# - "main"
# Publish `2.1.2` tags as releases.
tags:
- "*.*.*"
# pull_request:
# branches:
# - "main"
# allows you to run this workflow manually from the actions tab
# workflow_dispatch:
env:
app: mosquitto
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: create version
run: |
echo "VERSION=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
echo "MAJOR_VERSION=$(echo ${{ github.ref_name }} | sed -E 's/^([0-9]+)\.([0-9]+)\..+/\1.\2/')" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
secrets: |
MTC_PASSWD=${{ secrets.MTC_PASSWD }}
MTC_USERNAME=${{ secrets.MTC_USERNAME }}
ODS_PASSWD=${{ secrets.ODS_PASSWD }}
ODS_USERNAME=${{ secrets.ODS_USERNAME }}
# docker hub user/repo:tag
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/mosquitto:latest
${{ secrets.DOCKERHUB_USERNAME }}/mosquitto:${{ env.VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/mosquitto:${{ env.MAJOR_VERSION }}
# push to docker hub
push: true
# steps:
# - name: Build and push Docker images
# uses: docker/build-push-action@v2.5.0