Skip to content

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: build docker image
# Controls when the action will run.
on:
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
type: choice
options:
- info
- warning
- debug
push:
branches:
- "docker/**"
env:
TZ: Asia/Shanghai
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get image name
id: name
run: echo 'name=${{ github.ref_name }}' | awk '{sub(/docker/, "anscor"); print $0}' >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: true
tags: |
${{ steps.name.outputs.name }}:latest