dependency: (deps): bump fastapi from 0.128.7 to 0.128.8 in /backend #398
Workflow file for this run
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"] | |
| pull_request: | |
| branches: ["main"] | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build docker image and run tests | |
| run: | | |
| docker compose build | |
| docker compose up -d | |
| docker compose down | |
| frontend-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x, 22.x] | |
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| cache-dependency-path: "./frontend/package-lock.json" | |
| - run: npm ci | |
| working-directory: ./frontend | |
| - run: npm run build --if-present | |
| working-directory: ./frontend | |
| - run: npm test | |
| working-directory: ./frontend | |
| backend-build-and-test: | |
| name: continuous-integration | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Run pre-commit hooks (optional) | |
| run: | | |
| cd backend | |
| uv pip install --system pre-commit | |
| pre-commit run --all-files || true | |
| continue-on-error: true | |
| - name: Install and sync dependencies | |
| run: | | |
| cd backend | |
| uv sync --locked --all-extras | |
| - name: Run root tests | |
| run: | | |
| cd backend | |
| uv run pytest --doctest-modules --cov=src --cov-report=html | |
| deploy-backend-docs: | |
| name: Deploy to GitHub Pages | |
| needs: [backend-build-and-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install and sync dependencies | |
| run: | | |
| cd backend | |
| uv sync --group=docs --locked | |
| - name: Configure Git Credentials | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
| - run: | | |
| cd backend | |
| uv run mkdocs gh-deploy --force | |
| upload-docker-images: | |
| runs-on: ubuntu-latest | |
| needs: [build, frontend-build] | |
| if: github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Push Docker Backend Image | |
| run: | | |
| docker build -t ghcr.io/spiderpig02/galacticpathfinder-backend:latest ./backend | |
| docker push ghcr.io/spiderpig02/galacticpathfinder-backend:latest | |
| - name: Build and Push Docker Webapp Image | |
| run: | | |
| docker build -t ghcr.io/spiderpig02/galacticpathfinder-frontend:latest ./frontend | |
| docker push ghcr.io/spiderpig02/galacticpathfinder-frontend:latest | |
| dependabot: | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| name: "Dependabot" | |
| # After the other jobs complete, if one of them fails, it won't merge the PR. | |
| needs: [build, frontend-build] | |
| runs-on: ubuntu-latest | |
| # Detect that the PR author is dependabot | |
| if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} | |
| steps: | |
| - name: Enable auto-merge for Dependabot PRs | |
| # Use Github CLI to merge automatically the PR | |
| run: gh pr merge --auto --merge "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |