From e6a387744ed9e1d02aec24d818546c82d772f9ab Mon Sep 17 00:00:00 2001 From: Hayden Hargreaves Date: Sun, 28 Dec 2025 22:25:52 -0700 Subject: [PATCH] (FEAT): CI/CD attempt one. This needs a merge. --- .github/workflows/deploy.yml | 16 ++++++++++++++-- web/Dockerfile | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 72ef0ee..d39f022 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,6 @@ name: Deploy application with Docker -on: +on: push: branches: - master @@ -19,10 +19,22 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - - name: Build and push Docker image + - name: Build and push backend Docker image uses: docker/build-push-action@v3 with: context: . file: ./Dockerfile push: true tags: azpect3120/potion.gophernest:latest + + - name: Build and push frontend Docker image + uses: docker/build-push-action@v5 + with: + context: ./web + file: ./Dockerfile + push: true + tags: azpect3120/potion.frontend:latest + build-args: | + VITE_ENVIRONMENT=prod + VITE_DOMAIN_DEV=http://localhost:3000 + VITE_DOMAIN_PROD=https://potion-backend.gophernest.net diff --git a/web/Dockerfile b/web/Dockerfile index 00400f9..99fc94d 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -6,6 +6,16 @@ COPY package*.json ./ RUN npm install COPY . . + +# Build-time config: defaults are prod-safe, can be overridden if needed +ARG VITE_ENVIRONMENT=prod +ARG VITE_DOMAIN_DEV=http://localhost:3000 +ARG VITE_DOMAIN_PROD=https://potion-backend.gophernest.net + +ENV VITE_ENVIRONMENT=$VITE_ENVIRONMENT +ENV VITE_DOMAIN_DEV=$VITE_DOMAIN_DEV +ENV VITE_DOMAIN_PROD=$VITE_DOMAIN_PROD + RUN npm run build # Runtime stage