From cdeb0b0809e16aebe3e606757c4d1044c06bd3fc Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:02:47 +0000 Subject: [PATCH] fix: docker build --- .github/workflows/release.yml | 28 +++++++++++----------------- Dockerfile | 10 ++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e7bb16..9d0f3b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,43 +11,37 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - # Fetch submodules - submodules: recursive + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - env: - _BUILD_WEBSITE_URL: https://appwrite.io - _BUILD_WEBSITE_VERSION: 1.5.x - _BUILD_GIT_URL: https://github.com/appwrite/website.git - _BUILD_GIT_BRANCH: main + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: appwrite/assistant tags: type=semver,pattern={{major}}.{{minor}}.{{patch}} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + _BUILD_WEBSITE_URL=https://appwrite.io + _BUILD_WEBSITE_VERSION=1.5.x + _BUILD_GIT_URL=https://github.com/appwrite/website.git + _BUILD_GIT_BRANCH=main diff --git a/Dockerfile b/Dockerfile index aa46a05..fc62b0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,16 @@ RUN pnpm --prod install COPY . . +ARG _BUILD_GIT_URL +ARG _BUILD_GIT_BRANCH +ARG _BUILD_WEBSITE_URL +ARG _BUILD_WEBSITE_VERSION + +ENV _BUILD_GIT_URL=${_BUILD_GIT_URL} +ENV _BUILD_GIT_BRANCH=${_BUILD_GIT_BRANCH} +ENV _BUILD_WEBSITE_URL=${_BUILD_WEBSITE_URL} +ENV _BUILD_WEBSITE_VERSION=${_BUILD_WEBSITE_VERSION} + RUN pnpm run fetch-sources ENV _APP_ASSISTANT_OPENAI_API_KEY=''