diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index 2f1c60a..7e96d25 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -16,6 +16,8 @@ on: # manually run this workflow from the Actions tab workflow_dispatch: +env: + FORMAT_TIME: `date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g"` jobs: build-and-deploy: @@ -132,12 +134,15 @@ jobs: echo "current date is $(date)" echo "start to copy target jar" - formatTime=$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")" + + echo "FORMAT TIME IS ${FORMAT_TIME}" + export formatTime=`date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g"` echo "current format date is ${formatTime}" echo "write the version info to env" echo "AGENT_VERSION= ${formatTime}>> $GITHUB_ENV cp ./agent-*.jar ./octopus-agent-${formatTime}.jar + cp ./agent-*.jar ./octopus-agent-${{ env.AGENT_VERSION }}.jar cd /home/runner/work/ProjectOctopus/ProjectOctopus echo "--------------------------------------"