CI: bump actions off deprecated Node 20 runtime #91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI - Test & Build | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build test image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: deploy/docker/Dockerfile | |
| push: false | |
| load: true | |
| tags: caserover-api:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Test container starts | |
| run: | | |
| docker run -d --name test-api \ | |
| -e DATABASE_URL="mysql+pymysql://test:test@localhost:3306/test" \ | |
| -e USE_SSH_TUNNEL=false \ | |
| caserover-api:test | |
| # Wait for container to start | |
| sleep 10 | |
| # Check container is running | |
| docker ps | grep test-api | |
| # Show logs (will show DB connection errors, but that's expected without real DB) | |
| docker logs test-api | |
| # Cleanup | |
| docker stop test-api | |
| docker rm test-api |