优化筛选 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish docker | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
publish: | |
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 | |