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"