Skip to content

Commit

Permalink
version by service
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Oct 24, 2023
1 parent 6cbdfcd commit e715761
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 15 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/build_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/build_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/git/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker/proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit e715761

Please sign in to comment.