This page documents the continuous integration and deployment workflows that automate testing, building, and publishing the Docker images.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragnarok22/telegram-bot-api-docker/llms.txt
Use this file to discover all available pages before exploring further.
GitHub Actions Workflows Overview
The project uses three GitHub Actions workflows:| Workflow | Trigger | Purpose |
|---|---|---|
test | Push/PR to main | Runs entrypoint tests |
docker-smoke | Manual or reusable | Validates Docker build and runtime |
docker-release | Version tags (v*.*) | Builds and publishes multi-arch images |
Test Workflow
File:.github/workflows/test.yml
Trigger: Runs on every push or pull request targeting the main branch.
- Checks out the repository code
- Runs the shell test suite (
bash tests/run.sh) - Fails the build if any test fails
This workflow does NOT build the Docker image. It only validates the entrypoint script logic using mock binaries.
Docker Smoke Workflow
File:.github/workflows/docker-smoke.yml
Trigger:
- Manual dispatch (
workflow_dispatch) - Called by other workflows (
workflow_call)
Test entrypoint validation
Verifies that the container exits with an error when required environment variables are missing.
- Go to Actions → docker-smoke
- Click Run workflow
- Select the branch and click Run workflow
Docker Release Workflow
File:.github/workflows/docker-release.yml
Trigger: Pushing a version tag matching v*.* (e.g., v9.5, v9.5.0)
Set up multi-arch build environment
- Installs QEMU for cross-platform emulation
- Configures Docker Buildx for multi-arch builds
Authenticate to Docker Hub
Logs in using repository secrets (
DOCKERHUB_USERNAME and DOCKERHUB_TOKEN).Extract image metadata
Generates tags and labels from the Git tag (e.g.,
v9.5 → ragnarok22/telegram-bot-api-docker:9.5).Build and push multi-arch image
Builds for both
linux/amd64 and linux/arm64, then pushes to Docker Hub.Release Process and Versioning
To publish a new release:Monitor workflow execution
- Go to Actions tab in GitHub
- Watch the
ciworkflow run - Verify smoke tests pass
- Confirm multi-arch image is published
Version Tag Formats
The workflow triggers on tags matchingv*.*:
Valid tags:
v9.5→ Published as9.5andlatestv9.5.0→ Published as9.5.0andlatestv10.0→ Published as10.0andlatest
9.5(missingvprefix)release-9.5(doesn’t match pattern)v9(requires at least two version components)
Required Secrets
The release workflow requires two GitHub repository secrets:DOCKERHUB_USERNAME
Your Docker Hub username.
Setting the secret:
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
DOCKERHUB_USERNAME - Value: Your Docker Hub username (e.g.,
ragnarok22)
DOCKERHUB_TOKEN
A Docker Hub access token with push permissions.
Creating a token:
- Log in to Docker Hub
- Go to Account Settings → Security → Access Tokens
- Click New Access Token
- Name:
github-actions-telegram-bot-api - Permissions: Read, Write, Delete
- Copy the token (you won’t see it again)
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
DOCKERHUB_TOKEN - Value: Paste the access token
Multi-Arch Image Publishing
The release workflow builds for two architectures:| Platform | Architecture | Use Case |
|---|---|---|
linux/amd64 | x86_64 | Most cloud servers, Intel/AMD desktops |
linux/arm64 | ARM 64-bit | Apple Silicon, ARM servers, Raspberry Pi 4+ |
How Multi-Arch Works
QEMU emulation
The
docker/setup-qemu-action installs QEMU, allowing the AMD64 runner to build ARM64 images.Build Cache
The workflow uses GitHub Actions cache to speed up builds:- Subsequent builds reuse unchanged layers
- Multi-arch builds share cache between platforms
- Reduces build time from ~15 minutes to ~3 minutes
Monitoring CI/CD
Viewing Workflow Runs
- Go to the Actions tab in your GitHub repository
- Select the workflow (
test,docker-smoke, orci) - Click a specific run to view logs
Build Status Badges
Add status badges to your README:Common Build Failures
| Error | Cause | Solution |
|---|---|---|
DOCKERHUB_USERNAME not found | Missing secret | Add repository secret |
authentication failed | Invalid token | Regenerate Docker Hub token |
platform not supported | QEMU not set up | Ensure setup-qemu-action runs |
test failed | Entrypoint bug | Fix code and re-run tests |
tag already exists | Duplicate version | Use a new version tag |
Local Multi-Arch Build
You can replicate the release build locally:The
--load flag only works with a single platform. For multi-arch images, you must push to a registry or use docker buildx build --output type=oci,dest=image.tar.Best Practices
Test before tagging
Always run
bash tests/run.sh locally before creating a release tag.Semantic versioning
Follow upstream Telegram Bot API version numbers (e.g.,
v9.5).Update labels
Keep
org.opencontainers.image.version in sync with Git tags.Monitor workflows
Watch the Actions tab during releases to catch issues early.
Troubleshooting
Workflow doesn’t trigger on tag push
Check:- Tag matches
v*.*pattern (e.g.,v9.5, not9.5) - Tag was pushed to the repository:
git push origin v9.5 - Workflow file exists in the tagged commit
Multi-arch build is slow
Causes:- Cross-compilation uses QEMU emulation (ARM64 builds on AMD64 runners)
- No cache from previous runs
- First build will always be slow (~15 minutes)
- Subsequent builds reuse cache (~3 minutes)
- Use native runners for each architecture (requires GitHub Enterprise)
Docker Hub description not updated
Check:DOCKERHUB_TOKENhas read/write permissions- Repository name matches
github.repository(org/repo format) - README.md exists in the repository root