diff --git a/.github/workflows/build_deployment.yml b/.github/workflows/build_deployment.yml index 944ffc63..561e00ca 100644 --- a/.github/workflows/build_deployment.yml +++ b/.github/workflows/build_deployment.yml @@ -20,15 +20,30 @@ jobs: run: | version=$(grep -Po '(?<=LABEL version=").*?(?=")' docker/deployment/Dockerfile) echo $version - echo "::set-output name=version::$version" - new_version=${version},latest - echo "VERSION=$new_version" >> $GITHUB_ENV + real_version=${version%%-*} + echo "VERSION=$version" >> $GITHUB_ENV + if [ "$version" != "$real_version" ]; then + version_list=$version + else + IFS='.' read -ra VERSION_PARTS <<< "$real_version" + version_list="latest" + version_accumulator="" + for i in "${VERSION_PARTS[@]}"; do + if [ -z "$version_accumulator" ]; then + version_accumulator=$i + else + version_accumulator=$version_accumulator.$i + fi + version_list=$version_accumulator,$version_list + done + fi + echo "VERSION_LIST=$version_list" >> $GITHUB_ENV - uses: mr-smithers-excellent/docker-build-push@v5 name: Build & push Docker image with: image: websoft9dev/deployment - tags: ${{ env.VERSION }} + tags: ${{ env.VERSION_LIST }} addLatest: True registry: docker.io dockerfile: docker/deployment/Dockerfile diff --git a/.github/workflows/build_git.yml b/.github/workflows/build_git.yml index a79bb152..d9b20231 100644 --- a/.github/workflows/build_git.yml +++ b/.github/workflows/build_git.yml @@ -20,15 +20,30 @@ jobs: run: | version=$(grep -Po '(?<=LABEL version=").*?(?=")' docker/git/Dockerfile) echo $version - echo "::set-output name=version::$version" - new_version=${version},latest - echo "VERSION=$new_version" >> $GITHUB_ENV + real_version=${version%%-*} + echo "VERSION=$version" >> $GITHUB_ENV + if [ "$version" != "$real_version" ]; then + version_list=$version + else + IFS='.' read -ra VERSION_PARTS <<< "$real_version" + version_list="latest" + version_accumulator="" + for i in "${VERSION_PARTS[@]}"; do + if [ -z "$version_accumulator" ]; then + version_accumulator=$i + else + version_accumulator=$version_accumulator.$i + fi + version_list=$version_accumulator,$version_list + done + fi + echo "VERSION_LIST=$version_list" >> $GITHUB_ENV - uses: mr-smithers-excellent/docker-build-push@v5 name: Build & push Docker image with: image: websoft9dev/git - tags: ${{ env.VERSION }} + tags: ${{ env.VERSION_LIST }} addLatest: True registry: docker.io dockerfile: docker/git/Dockerfile diff --git a/.github/workflows/build_proxy.yml b/.github/workflows/build_proxy.yml index f1164768..ab92eb63 100644 --- a/.github/workflows/build_proxy.yml +++ b/.github/workflows/build_proxy.yml @@ -20,15 +20,30 @@ jobs: run: | version=$(grep -Po '(?<=LABEL version=").*?(?=")' docker/proxy/Dockerfile) echo $version - echo "::set-output name=version::$version" - new_version=${version},latest - echo "VERSION=$new_version" >> $GITHUB_ENV + real_version=${version%%-*} + echo "VERSION=$version" >> $GITHUB_ENV + if [ "$version" != "$real_version" ]; then + version_list=$version + else + IFS='.' read -ra VERSION_PARTS <<< "$real_version" + version_list="latest" + version_accumulator="" + for i in "${VERSION_PARTS[@]}"; do + if [ -z "$version_accumulator" ]; then + version_accumulator=$i + else + version_accumulator=$version_accumulator.$i + fi + version_list=$version_accumulator,$version_list + done + fi + echo "VERSION_LIST=$version_list" >> $GITHUB_ENV - uses: mr-smithers-excellent/docker-build-push@v5 name: Build & push Docker image with: image: websoft9dev/proxy - tags: ${{ env.VERSION }} + tags: ${{ env.VERSION_LIST }} addLatest: True registry: docker.io dockerfile: docker/proxy/Dockerfile diff --git a/docker/deployment/Dockerfile b/docker/deployment/Dockerfile index 321003ea..bda214c5 100644 --- a/docker/deployment/Dockerfile +++ b/docker/deployment/Dockerfile @@ -1,4 +1,4 @@ -# modify time: 2023102400933, you can modify here to trigger Docker Build action +# modify time: 202310241733, you can modify here to trigger Docker Build action # step1: Build entrypoint execute program init_portainer by golang FROM golang:latest AS builder diff --git a/docker/git/Dockerfile b/docker/git/Dockerfile index 0dba145d..8072ba72 100644 --- a/docker/git/Dockerfile +++ b/docker/git/Dockerfile @@ -1,4 +1,4 @@ -# modify time: 202310181524, you can modify here to trigger Docker Build action +# modify time: 202310241724, you can modify here to trigger Docker Build action # Dockerfile refer to: https://github.com/go-gitea/gitea/blob/main/Dockerfile FROM gitea/gitea:1.20.4 diff --git a/docker/proxy/Dockerfile b/docker/proxy/Dockerfile index 046c2b1e..c1fa2f53 100644 --- a/docker/proxy/Dockerfile +++ b/docker/proxy/Dockerfile @@ -1,4 +1,4 @@ -# modify time: 202310240910, you can modify here to trigger Docker Build action +# modify time: 202310241700, you can modify here to trigger Docker Build action # Dockerfile refer to:https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/Dockerfile FROM jc21/nginx-proxy-manager:2.10.4