Skip to content

Json upload mode (#21) #3

Json upload mode (#21)

Json upload mode (#21) #3

Workflow file for this run

name: Docker Hub Publish
on:
push:
tags:
- 'v*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get build info
id: build_info
run: |
echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "buildtime=$(date -u '+%Y-%m-%d_%H:%M:%S')" >> $GITHUB_OUTPUT
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: dhcgn/iot-ephemeral-value-store-server
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
VERSION=${{ steps.build_info.outputs.version }}
COMMIT=${{ steps.build_info.outputs.commit }}
BUILDTIME=${{ steps.build_info.outputs.buildtime }}