feat(ci): Add Docker image building and pushing to the ghcr registry#18
Merged
Conversation
Contributor
Руководство для рецензентаНастраивает CI на запуск только для ветки Блок-схема CI-процесса со сборкой и публикацией Docker-образовflowchart TD
push_main[Push to main] --> ci_workflow[CI workflow]
ci_workflow --> tests_job[tests job]
tests_job --> build_and_push_job[build-and-push job]
build_and_push_job --> login_ghcr[docker/login-action]
login_ghcr --> setup_buildx[docker/setup-buildx-action]
setup_buildx --> build_push_api[docker/build-push-action API]
setup_buildx --> build_push_bot[docker/build-push-action Bot]
build_push_api --> ghcr_api[ghcr.io steeltime-api image]
build_push_bot --> ghcr_bot[ghcr.io steeltime-bot image]
Изменения на уровне файлов
Подсказки и командыВзаимодействие с Sourcery
Настройка вашего опытаПерейдите в свою панель управления, чтобы:
Получение помощи
Original review guide in EnglishReviewer's GuideConfigures CI to run only on main and adds a Docker-based build-and-push job that, after tests pass, logs into GitHub Container Registry and builds/pushes API and Bot images using dedicated Dockerfiles. Flow diagram for CI workflow with Docker image build and pushflowchart TD
push_main[Push to main] --> ci_workflow[CI workflow]
ci_workflow --> tests_job[tests job]
tests_job --> build_and_push_job[build-and-push job]
build_and_push_job --> login_ghcr[docker/login-action]
login_ghcr --> setup_buildx[docker/setup-buildx-action]
setup_buildx --> build_push_api[docker/build-push-action API]
setup_buildx --> build_push_bot[docker/build-push-action Bot]
build_push_api --> ghcr_api[ghcr.io steeltime-api image]
build_push_bot --> ghcr_bot[ghcr.io steeltime-bot image]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Привет — я нашёл 1 проблему и оставил немного общего фидбэка:
- Обновление триггера
pushтак, чтобы он запускался только наmain, означает, что CI (включая новый Docker-сборку) больше не будет запускаться при пушах вdevelop. Пожалуйста, перепроверьте, соответствует ли это вашей планируемой стратегии ветвления, чтобы изменения вdevelopне сливались без обратной связи от CI. - Docker-образы помечаются только тегом
latest; стоит также добавлять тег с неизменяемым идентификатором, например, SHA коммита или версией (например,${{ github.sha }}), чтобы упростить откаты и отладку и избежать неоднозначности в том, какой код задеплоен.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Updating the `push` trigger to only run on `main` means CI (including the new Docker build) will no longer run on `develop` pushes; double-check this matches your intended branching strategy so changes in `develop` aren’t merged without CI feedback.
- The Docker images are only tagged as `latest`; consider also tagging with something immutable like the commit SHA or a version (e.g., `${{ github.sha }}`) to make rollbacks and debugging easier and avoid ambiguity around which code is deployed.
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="110-118" />
<code_context>
+ context: .
+ file: Dockerfile.api
+ push: true
+ tags: ghcr.io/fl1rix/steeltime-api:latest
+ -
+ name: Build and Push Bot
+ uses: docker/build-push-action@v7
+ with:
+ context: .
+ file: Dockerfile.bot
+ push: true
+ tags: ghcr.io/fl1rix/steeltime-bot:latest
\ No newline at end of file
</code_context>
<issue_to_address>
**suggestion:** Add immutable tags (e.g., commit SHA) in addition to `latest` to make image versions traceable.
Relying only on `latest` means each push to `main` overwrites the previous image, making rollbacks and debugging difficult. Please also tag images with an immutable identifier (e.g. `${{ github.sha }}`), for example:
`tags: ghcr.io/fl1rix/steeltime-api:latest,ghcr.io/fl1rix/steeltime-api:${{ github.sha }}`
so you can reliably link running images back to a specific commit and perform safe rollbacks.
Suggested implementation:
```
tags: ghcr.io/fl1rix/steeltime-api:latest,ghcr.io/fl1rix/steeltime-api:${{ github.sha }}
```
```
tags: ghcr.io/fl1rix/steeltime-bot:latest,ghcr.io/fl1rix/steeltime-bot:${{ github.sha }}
```
</issue_to_address>Sourcery бесплатен для open source — если вам нравятся наши ревью, пожалуйста, подумайте о том, чтобы поделиться ими ✨
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- Updating the
pushtrigger to only run onmainmeans CI (including the new Docker build) will no longer run ondeveloppushes; double-check this matches your intended branching strategy so changes indeveloparen’t merged without CI feedback. - The Docker images are only tagged as
latest; consider also tagging with something immutable like the commit SHA or a version (e.g.,${{ github.sha }}) to make rollbacks and debugging easier and avoid ambiguity around which code is deployed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Updating the `push` trigger to only run on `main` means CI (including the new Docker build) will no longer run on `develop` pushes; double-check this matches your intended branching strategy so changes in `develop` aren’t merged without CI feedback.
- The Docker images are only tagged as `latest`; consider also tagging with something immutable like the commit SHA or a version (e.g., `${{ github.sha }}`) to make rollbacks and debugging easier and avoid ambiguity around which code is deployed.
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="110-118" />
<code_context>
+ context: .
+ file: Dockerfile.api
+ push: true
+ tags: ghcr.io/fl1rix/steeltime-api:latest
+ -
+ name: Build and Push Bot
+ uses: docker/build-push-action@v7
+ with:
+ context: .
+ file: Dockerfile.bot
+ push: true
+ tags: ghcr.io/fl1rix/steeltime-bot:latest
\ No newline at end of file
</code_context>
<issue_to_address>
**suggestion:** Add immutable tags (e.g., commit SHA) in addition to `latest` to make image versions traceable.
Relying only on `latest` means each push to `main` overwrites the previous image, making rollbacks and debugging difficult. Please also tag images with an immutable identifier (e.g. `${{ github.sha }}`), for example:
`tags: ghcr.io/fl1rix/steeltime-api:latest,ghcr.io/fl1rix/steeltime-api:${{ github.sha }}`
so you can reliably link running images back to a specific commit and perform safe rollbacks.
Suggested implementation:
```
tags: ghcr.io/fl1rix/steeltime-api:latest,ghcr.io/fl1rix/steeltime-api:${{ github.sha }}
```
```
tags: ghcr.io/fl1rix/steeltime-bot:latest,ghcr.io/fl1rix/steeltime-bot:${{ github.sha }}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
f679593 to
5fc98fc
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Добавить этапы сборки и публикации Docker-образов в конвейер CI для push-событий в ветку main.
CI:
Original summary in English
Summary by Sourcery
Add Docker image build and publish steps to the CI pipeline for main branch pushes.
CI: