Files
Oxicloud/.github/workflows/docker-build.yml
T
Dionisio 1e8a7dd5bb feat: redesign admin panel & profile page, optimize Dockerfile, remove rootless
- Completely redesign admin.html matching OxiCloud design system
- Create standalone profile.html page with avatar, details & password change
- Optimize Dockerfile: 3-stage build, non-root user, OCI labels, layer cache
- Add .dockerignore to reduce build context
- Remove redundant Dockerfile.rootless & rootless-compose.yml
- Redesign login language selector as compact dropdown with search
- Fix CI/CD workflows (ci.yml, docker-build.yml, docker-publish.yml)
- Update app.js to navigate to profile page instead of modal
2026-02-11 14:09:40 +01:00

77 lines
2.2 KiB
YAML

name: Docker Build and Test
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
build-and-test:
name: Build and Test Docker Image
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: test/oxicloud
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
load: true
tags: test/oxicloud:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify image starts correctly
run: |
# Start the container in background
docker run -d --name oxicloud-test \
-e DATABASE_URL="postgres://test:test@localhost/test" \
-p 8080:8080 \
test/oxicloud:test || true
# Give it a moment to start (or fail)
sleep 3
# Check that the container exists and show logs
echo "=== Container status ==="
docker ps -a --filter name=oxicloud-test
echo "=== Container logs ==="
docker logs oxicloud-test 2>&1 || true
# Cleanup
docker rm -f oxicloud-test || true
- name: Verify image structure
run: |
echo "=== Image size ==="
docker image ls test/oxicloud:test
echo "=== Binary exists and is executable ==="
docker run --rm --entrypoint sh test/oxicloud:test -c "test -x /usr/local/bin/oxicloud && echo 'OK: binary is executable'"
echo "=== Static files present ==="
docker run --rm --entrypoint sh test/oxicloud:test -c "ls /app/static/index.html && echo 'OK: static files present'"
echo "=== DB schema present ==="
docker run --rm --entrypoint sh test/oxicloud:test -c "ls /app/db/schema.sql && echo 'OK: schema present'"
echo "✅ Docker build and test completed successfully"