From d0c165eba40511baae191cbf82c59487a4cf527d Mon Sep 17 00:00:00 2001 From: Oliver Gwyther Date: Wed, 20 Aug 2025 03:37:20 +0100 Subject: [PATCH] Update GitHub Actions workflow to include environment variables for frontend build and enhance Docker image verification process for both frontend and API images. --- .github/workflows/build.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4927283..0989a0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,10 @@ jobs: - name: Build frontend run: npm run build + env: + VITE_APP_NAME: ScriptShare + VITE_APP_URL: https://scriptshare.example.com + VITE_ANALYTICS_ENABLED: false - name: Build API run: npm run build:api @@ -50,6 +54,10 @@ jobs: file: ./Dockerfile push: false tags: scriptshare-frontend:latest + build-args: | + VITE_APP_NAME=ScriptShare + VITE_APP_URL=https://scriptshare.example.com + VITE_ANALYTICS_ENABLED=false - name: Build API Docker image uses: docker/build-push-action@v5 @@ -62,4 +70,18 @@ jobs: - name: Test Docker containers run: | # Test that images were built successfully - docker images | grep scriptshare + docker images scriptshare-frontend + docker images scriptshare-api + + # Verify images exist + if ! docker images scriptshare-frontend --format "table {{.Repository}}\t{{.Tag}}" | grep -q "scriptshare-frontend"; then + echo "Frontend Docker image build failed" + exit 1 + fi + + if ! docker images scriptshare-api --format "table {{.Repository}}\t{{.Tag}}" | grep -q "scriptshare-api"; then + echo "API Docker image build failed" + exit 1 + fi + + echo "✅ All Docker images built successfully"