From 0b1cf462fd14c11dabf04801b58d8fd988c593d1 Mon Sep 17 00:00:00 2001 From: truskovskiyk Date: Fri, 20 Dec 2024 23:44:11 +0100 Subject: [PATCH] never do this again: OKAY --- .github/workflows/ci.yml | 3 +++ no-ocr-ui/.env | 2 -- no-ocr-ui/Dockerfile | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 no-ocr-ui/.env diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66baf65..b6df94f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,9 @@ jobs: context: no-ocr-ui push: true tags: ghcr.io/kyryl-opens-ml/no-ocr-ui:latest + build-args: | + VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL }} + VITE_SUPABASE_ANON_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY }} cache-from: type=registry,ref=ghcr.io/kyryl-opens-ml/no-ocr-ui:buildcache cache-to: type=registry,ref=ghcr.io/kyryl-opens-ml/no-ocr-ui:buildcache,mode=max diff --git a/no-ocr-ui/.env b/no-ocr-ui/.env deleted file mode 100644 index e1fe443..0000000 --- a/no-ocr-ui/.env +++ /dev/null @@ -1,2 +0,0 @@ -VITE_SUPABASE_URL=https://cdazhclrvpqparjhcihs.supabase.co -VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNkYXpoY2xydnBxcGFyamhjaWhzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzQxMzE3MjMsImV4cCI6MjA0OTcwNzcyM30.Hl1CGJVLG0awBGtZXpNNYZfZ8VWWG31diffcQqbZozk \ No newline at end of file diff --git a/no-ocr-ui/Dockerfile b/no-ocr-ui/Dockerfile index b534b27..2c5fda1 100644 --- a/no-ocr-ui/Dockerfile +++ b/no-ocr-ui/Dockerfile @@ -12,8 +12,12 @@ RUN npm install # Copy the rest of the application code COPY . . +# Set build-time environment variables +ARG VITE_SUPABASE_URL +ARG VITE_SUPABASE_ANON_KEY + # Build the application -RUN npm run build +RUN VITE_SUPABASE_URL=$VITE_SUPABASE_URL VITE_SUPABASE_ANON_KEY=$VITE_SUPABASE_ANON_KEY npm run build # Stage 2: Serve the application FROM nginx:alpine