Update GitHub Actions workflow to include environment variables for frontend build and enhance Docker image verification process for both frontend and API images.

This commit is contained in:
2025-08-20 03:37:20 +01:00
parent 58d8886480
commit d0c165eba4

View File

@ -28,6 +28,10 @@ jobs:
- name: Build frontend - name: Build frontend
run: npm run build run: npm run build
env:
VITE_APP_NAME: ScriptShare
VITE_APP_URL: https://scriptshare.example.com
VITE_ANALYTICS_ENABLED: false
- name: Build API - name: Build API
run: npm run build:api run: npm run build:api
@ -50,6 +54,10 @@ jobs:
file: ./Dockerfile file: ./Dockerfile
push: false push: false
tags: scriptshare-frontend:latest 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 - name: Build API Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
@ -62,4 +70,18 @@ jobs:
- name: Test Docker containers - name: Test Docker containers
run: | run: |
# Test that images were built successfully # 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"