-
Notifications
You must be signed in to change notification settings - Fork 744
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,56 @@ | ||||||
| name: Create and publish a Docker image | ||||||
|
|
||||||
| on: | ||||||
| release: | ||||||
| types: [published] | ||||||
| push: | ||||||
| branches: | ||||||
| - master | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
|
|
||||||
| env: | ||||||
| REGISTRY: ghcr.io | ||||||
| IMAGE_NAME: ${{ github.repository }} | ||||||
|
|
||||||
| jobs: | ||||||
| build-and-push-image: | ||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: read | ||||||
| packages: write | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v2 | ||||||
|
|
||||||
| - name: Login to GitHub Container Registry | ||||||
| uses: docker/login-action@v3 | ||||||
| with: | ||||||
| registry: ghcr.io | ||||||
| username: ${{ github.actor }} | ||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
|
||||||
| - name: Extract metadata (tags, labels) for Docker | ||||||
| id: meta | ||||||
| uses: docker/metadata-action@v5 | ||||||
| with: | ||||||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||||||
| tags: | | ||||||
| ${{ github.event_name == 'release' && github.event.release.tag_name == 'latest' && 'latest' || '' }} | ||||||
|
||||||
| ${{ github.event_name == 'release' && github.event.release.tag_name == 'latest' && 'latest' || '' }} | |
| ${{ github.event_name == 'release' && '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 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}} |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||
| FROM ubuntu as BUILD | ||||||||
|
|
||||||||
| WORKDIR /app | ||||||||
|
|
||||||||
| COPY . . | ||||||||
|
|
||||||||
|
Comment on lines
+5
to
+6
|
||||||||
| COPY . . | |
| # COPY . . | |
| RUN git clone --recurse-submodules <repo_url> . |
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 |
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.