docs: document Dev Hub infrastructure #43
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, dev] | |
| tags: ['v*.*.*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-and-test: | |
| name: Lint & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f pyproject.toml ]; then | |
| pip install -e ".[dev]" 2>/dev/null || pip install -e . | |
| elif [ -f requirements.txt ]; then | |
| pip install -r requirements.txt -r requirements-dev.txt | |
| fi | |
| - name: Lint with ruff | |
| run: ruff check . | |
| - name: Run tests | |
| run: | | |
| if [ -d tests ]; then | |
| pytest --tb=short -q --cov --cov-report=term-missing | |
| else | |
| echo "No tests directory found, skipping pytest" | |
| fi | |
| frontend: | |
| name: Frontend Build & Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: omnibioai-dev-hub-ui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: omnibioai-dev-hub-ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm test | |
| docker: | |
| name: Build & Push Docker image | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-test, frontend] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=raw,value=latest | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |