Compare commits
3 Commits
v1.5.2-rc.
...
v1.5.2-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9b57f16c0 | ||
|
|
03d2a2a278 | ||
|
|
82efc5f589 |
20
.github/workflows/publish.yml
vendored
20
.github/workflows/publish.yml
vendored
@@ -7,6 +7,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm/v6
|
||||||
|
- linux/arm/v7
|
||||||
|
- linux/arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -32,11 +40,7 @@ jobs:
|
|||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GH_TOKEN }}
|
password: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- name: Build the docker image
|
- name: Build and push the docker image
|
||||||
run: ./docker/build.sh
|
run: ./docker/buildx-and-push.sh
|
||||||
|
env:
|
||||||
- name: Push the docker image to DockerHub
|
PLATFORM: ${{ matrix.platform }}
|
||||||
run: docker push --all-tags documenso/documenso
|
|
||||||
|
|
||||||
- name: Push the docker image to GitHub Container Registry
|
|
||||||
run: docker push --all-tags ghcr.io/documenso/documenso
|
|
||||||
|
|||||||
35
docker/buildx-and-push.sh
Executable file
35
docker/buildx-and-push.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
command -v docker >/dev/null 2>&1 || {
|
||||||
|
echo "Docker is not running. Please start Docker and try again."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(readlink -f "$(dirname "$0")")"
|
||||||
|
MONOREPO_ROOT="$(readlink -f "$SCRIPT_DIR/../")"
|
||||||
|
|
||||||
|
# Get the platform from environment variable or set to linux/amd64 if not set
|
||||||
|
# quote the string to prevent word splitting
|
||||||
|
if [ -z "$PLATFORM" ]; then
|
||||||
|
PLATFORM="linux/amd64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
APP_VERSION="$(git name-rev --tags --name-only $(git rev-parse HEAD) | head -n 1 | sed 's/\^0//')"
|
||||||
|
GIT_SHA="$(git rev-parse HEAD)"
|
||||||
|
|
||||||
|
echo "Building docker image for monorepo at $MONOREPO_ROOT"
|
||||||
|
echo "App version: $APP_VERSION"
|
||||||
|
echo "Git SHA: $GIT_SHA"
|
||||||
|
|
||||||
|
docker buildx build \
|
||||||
|
-f "$SCRIPT_DIR/Dockerfile" \
|
||||||
|
--platform=$PLATFORM \
|
||||||
|
--progress=plain \
|
||||||
|
-t "documenso/documenso:latest" \
|
||||||
|
-t "documenso/documenso:$GIT_SHA" \
|
||||||
|
-t "documenso/documenso:$APP_VERSION" \
|
||||||
|
-t "ghcr.io/documenso/documenso:latest" \
|
||||||
|
-t "ghcr.io/documenso/documenso:$GIT_SHA" \
|
||||||
|
-t "ghcr.io/documenso/documenso:$APP_VERSION" \
|
||||||
|
--push \
|
||||||
|
"$MONOREPO_ROOT"
|
||||||
Reference in New Issue
Block a user