succeed backend local #5
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 | |
on: | |
push: | |
branches: [ main, development ] | |
pull_request: | |
branches: [ main, development ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Copy environment file | |
run: cp .env.development .env | |
- name: Build and test | |
run: | | |
docker compose version | |
docker compose -f docker-compose.dev.yml build | |
docker compose -f docker-compose.dev.yml up -d | |
docker compose -f docker-compose.dev.yml exec -T reproschema python -m pytest tests/ | |
docker compose -f docker-compose.dev.yml down | |
env: | |
NODE_ENV: development | |
DEV_MODE: 1 | |
PROJECT_NAME: development | |
SCHEMA_URL: http://localhost:80/schema/demo-protocol.json | |
LOCAL_SCHEMA_DIR: ./schemas | |
FRONTEND_PORT: 3000 | |
BACKEND_PORT: 8000 | |
PORT: 80 | |
NGINX_HOST: localhost | |
docker: | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker images | |
run: | | |
docker compose -f docker-compose.yml build | |
docker compose -f docker-compose.yml push |