Compare commits

...

5 Commits

Author SHA1 Message Date
Adithya Krishna
03e6388968 chore: added form reset for onCancel
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2024-03-08 23:25:02 +05:30
Lucas Smith
b9b57f16c0 fix: use matrix build 2024-03-07 05:05:35 +00:00
Lucas Smith
03d2a2a278 fix: update buildx platform arg 2024-03-07 04:35:25 +00:00
Lucas Smith
82efc5f589 fix: use docker buildx and push 2024-03-07 04:07:55 +00:00
Lucas Smith
8a9588ca65 fix: fetch tags for publish action 2024-03-07 03:49:03 +00:00
4 changed files with 69 additions and 10 deletions

View File

@@ -7,9 +7,19 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@@ -30,11 +40,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Build the docker image
run: ./docker/build.sh
- name: Push the docker image to DockerHub
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
- name: Build and push the docker image
run: ./docker/buildx-and-push.sh
env:
PLATFORM: ${{ matrix.platform }}

View File

@@ -197,7 +197,16 @@ export const EnableAuthenticatorAppDialog = ({
/>
<DialogFooter>
<Button type="button" variant="secondary" onClick={() => onOpenChange(false)}>
<Button
type="button"
variant="secondary"
onClick={() => {
setupTwoFactorAuthenticationForm.reset({
password: '',
});
onOpenChange(false);
}}
>
Cancel
</Button>

View File

@@ -138,7 +138,16 @@ export const ViewRecoveryCodesDialog = ({ open, onOpenChange }: ViewRecoveryCode
/>
<DialogFooter>
<Button type="button" variant="secondary" onClick={() => onOpenChange(false)}>
<Button
type="button"
variant="secondary"
onClick={() => {
viewRecoveryCodesForm.reset({
password: '',
});
onOpenChange(false);
}}
>
Cancel
</Button>

35
docker/buildx-and-push.sh Executable file
View 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"