fix: не поднимать базовый образ до релиз-кандидата питона (#30) #62
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: Python CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| # setup-python не нужен: версию питона держит .python-version, и uv сам | |
| # ставит её при первом `uv sync`. Единый источник версии, поэтому раннер | |
| # и образ кита не могут разойтись. | |
| - uses: astral-sh/setup-uv@v10.0.0 | |
| - name: Install | |
| run: make install | |
| - name: Run linter | |
| run: make lint | |
| # Тестов у примера нет: каждый шаг курса это отдельная ветка-снимок | |
| # приложения, а не покрытый тестами проект. Поэтому в CI только линтер. | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: true | |
| cache-from: ghcr.io/${{ github.repository }}:latest | |
| cache-to: type=inline | |
| tags: ghcr.io/${{ github.repository }}:latest |