-
Notifications
You must be signed in to change notification settings - Fork 743
Dockerfile / GHCR workflow #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Docker containerization and GitHub Container Registry (GHCR) publishing workflow for the telegram-bot-api project. The changes enable automated building and distribution of Docker images.
- Added multi-stage Dockerfile for building and packaging the telegram-bot-api
- Created GitHub Actions workflow for automated Docker image building and publishing to GHCR
- Configured triggers for releases, master branch pushes, and manual workflow dispatch
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| Dockerfile | Multi-stage build configuration with Ubuntu base for compiling and distributing the telegram-bot-api |
| .github/workflows/docker-image.yml | GitHub Actions workflow for automated Docker image builds and GHCR publishing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an outdated checkout action version poses security risks. actions/checkout@v2 has known vulnerabilities that have been addressed in newer versions.
| uses: actions/checkout@v2 | |
| uses: actions/checkout@v4 |
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| ${{ github.event_name == 'release' && github.event.release.tag_name == 'latest' && 'latest' || '' }} |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for tagging 'latest' is incorrect. Release tag names are typically version numbers (e.g., 'v1.0.0'), not 'latest'. This condition will never be true. Consider using ${{ github.event_name == 'release' && 'latest' || '' }} to tag all releases as latest.
| ${{ github.event_name == 'release' && github.event.release.tag_name == 'latest' && 'latest' || '' }} | |
| ${{ github.event_name == 'release' && 'latest' || '' }} |
| ${{ github.event_name == 'release' && github.event.release.tag_name == 'latest' && 'latest' || '' }} | ||
| ${{ github.sha }} | ||
| type=ref,event=branch | ||
| type=pep440,pattern={{version}} |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pep440 tag type is designed for Python packages, not for general release versioning. For a telegram-bot-api project, use type=semver,pattern={{version}} instead to properly handle semantic versioning.
| type=pep440,pattern={{version}} | |
| type=semver,pattern={{version}} |
|
|
||
| COPY . . | ||
|
|
||
| RUN apt update && apt install libssl-dev gperf git build-essential cmake zlib1g-dev ccache git -y |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package 'git' is listed twice in the installation command. Remove the duplicate to clean up the package list.
| RUN apt update && apt install libssl-dev gperf git build-essential cmake zlib1g-dev ccache git -y | |
| RUN apt update && apt install libssl-dev gperf git build-essential cmake zlib1g-dev ccache -y |
| COPY . . | ||
|
|
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git submodule initialization requires the .git directory, but COPY . . may not include it depending on .dockerignore settings. Consider adding --recurse-submodules to the git clone command in the workflow or ensure .git is copied.
| COPY . . | |
| # COPY . . | |
| RUN git clone --recurse-submodules <repo_url> . |
No description provided.