Skip to content

Create build

Create build #2

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
docker login --username=springhgui0127 registry.cn-hangzhou.aliyuncs.com --password=${{ secrets.PASSWORD }}
version=$(grep "<Version>" src/Directory.Build.props | awk -F'[<>]' '{print $3}')
echo $version
appName=registry.cn-hangzhou.aliyuncs.com/hgui/opentask
tag=$appName:$version-$(date +%s)
latestTag=$appName:latest
echo $tag
docker build . --file Dockerfile --tag $tag
docker push $tag
docker tag $tag $latestTag
docker push $latestTag