Skip to content

Commit 05894c5

Browse files
Merge pull request #6121 from makeplane/preview
release: v0.24.0
2 parents c68658d + 5926c9e commit 05894c5

File tree

1,000 files changed

+36621
-21731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,000 files changed

+36621
-21731
lines changed
+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: "Build and Push Docker Image"
2+
description: "Reusable action for building and pushing Docker images"
3+
inputs:
4+
docker-username:
5+
description: "The Dockerhub username"
6+
required: true
7+
docker-token:
8+
description: "The Dockerhub Token"
9+
required: true
10+
11+
# Docker Image Options
12+
docker-image-owner:
13+
description: "The owner of the Docker image"
14+
required: true
15+
docker-image-name:
16+
description: "The name of the Docker image"
17+
required: true
18+
build-context:
19+
description: "The build context"
20+
required: true
21+
default: "."
22+
dockerfile-path:
23+
description: "The path to the Dockerfile"
24+
required: true
25+
build-args:
26+
description: "The build arguments"
27+
required: false
28+
default: ""
29+
30+
# Buildx Options
31+
buildx-driver:
32+
description: "Buildx driver"
33+
required: true
34+
default: "docker-container"
35+
buildx-version:
36+
description: "Buildx version"
37+
required: true
38+
default: "latest"
39+
buildx-platforms:
40+
description: "Buildx platforms"
41+
required: true
42+
default: "linux/amd64"
43+
buildx-endpoint:
44+
description: "Buildx endpoint"
45+
required: true
46+
default: "default"
47+
48+
# Release Build Options
49+
build-release:
50+
description: "Flag to publish release"
51+
required: false
52+
default: "false"
53+
build-prerelease:
54+
description: "Flag to publish prerelease"
55+
required: false
56+
default: "false"
57+
release-version:
58+
description: "The release version"
59+
required: false
60+
default: "latest"
61+
62+
runs:
63+
using: "composite"
64+
steps:
65+
- name: Set Docker Tag
66+
shell: bash
67+
env:
68+
IMG_OWNER: ${{ inputs.docker-image-owner }}
69+
IMG_NAME: ${{ inputs.docker-image-name }}
70+
BUILD_RELEASE: ${{ inputs.build-release }}
71+
IS_PRERELEASE: ${{ inputs.build-prerelease }}
72+
REL_VERSION: ${{ inputs.release-version }}
73+
run: |
74+
FLAT_BRANCH_VERSION=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9.-]//g')
75+
76+
if [ "${{ env.BUILD_RELEASE }}" == "true" ]; then
77+
semver_regex="^v([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$"
78+
if [[ ! ${{ env.REL_VERSION }} =~ $semver_regex ]]; then
79+
echo "Invalid Release Version Format : ${{ env.REL_VERSION }}"
80+
echo "Please provide a valid SemVer version"
81+
echo "e.g. v1.2.3 or v1.2.3-alpha-1"
82+
echo "Exiting the build process"
83+
exit 1 # Exit with status 1 to fail the step
84+
fi
85+
86+
TAG=${{ env.IMG_OWNER }}/${{ env.IMG_NAME }}:${{ env.REL_VERSION }}
87+
88+
if [ "${{ env.IS_PRERELEASE }}" != "true" ]; then
89+
TAG=${TAG},${{ env.IMG_OWNER }}/${{ env.IMG_NAME }}:stable
90+
fi
91+
elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
92+
TAG=${{ env.IMG_OWNER }}/${{ env.IMG_NAME }}:latest
93+
else
94+
TAG=${{ env.IMG_OWNER }}/${{ env.IMG_NAME }}:${FLAT_BRANCH_VERSION}
95+
fi
96+
97+
echo "DOCKER_TAGS=${TAG}" >> $GITHUB_ENV
98+
- name: Login to Docker Hub
99+
uses: docker/login-action@v3
100+
with:
101+
username: ${{ inputs.docker-username }}
102+
password: ${{ inputs.docker-token}}
103+
104+
- name: Set up Docker Buildx
105+
uses: docker/setup-buildx-action@v3
106+
with:
107+
driver: ${{ inputs.buildx-driver }}
108+
version: ${{ inputs.buildx-version }}
109+
endpoint: ${{ inputs.buildx-endpoint }}
110+
111+
- name: Check out the repo
112+
uses: actions/checkout@v4
113+
114+
- name: Build and Push Docker Image
115+
uses: docker/[email protected]
116+
with:
117+
context: ${{ inputs.build-context }}
118+
file: ${{ inputs.dockerfile-path }}
119+
platforms: ${{ inputs.buildx-platforms }}
120+
tags: ${{ env.DOCKER_TAGS }}
121+
push: true
122+
build-args: ${{ inputs.build-args }}
123+
env:
124+
DOCKER_BUILDKIT: 1
125+
DOCKER_USERNAME: ${{ inputs.docker-username }}
126+
DOCKER_PASSWORD: ${{ inputs.docker-token }}

.github/workflows/build-aio-base.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
endpoint: ${{ env.BUILDX_ENDPOINT }}
8484

8585
- name: Build and Push to Docker Hub
86-
uses: docker/build-push-action@v5.1.0
86+
uses: docker/build-push-action@v6.9.0
8787
with:
8888
context: ./aio
8989
file: ./aio/Dockerfile-base-full
@@ -124,7 +124,7 @@ jobs:
124124
endpoint: ${{ env.BUILDX_ENDPOINT }}
125125

126126
- name: Build and Push to Docker Hub
127-
uses: docker/build-push-action@v5.1.0
127+
uses: docker/build-push-action@v6.9.0
128128
with:
129129
context: ./aio
130130
file: ./aio/Dockerfile-base-slim

.github/workflows/build-aio-branch.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
uses: actions/checkout@v4
129129

130130
- name: Build and Push to Docker Hub
131-
uses: docker/build-push-action@v5.1.0
131+
uses: docker/build-push-action@v6.9.0
132132
with:
133133
context: .
134134
file: ./aio/Dockerfile-app
@@ -188,7 +188,7 @@ jobs:
188188
uses: actions/checkout@v4
189189

190190
- name: Build and Push to Docker Hub
191-
uses: docker/build-push-action@v5.1.0
191+
uses: docker/build-push-action@v6.9.0
192192
with:
193193
context: .
194194
file: ./aio/Dockerfile-app

0 commit comments

Comments
 (0)