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:
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@ -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"
|
||||
|
Reference in New Issue
Block a user